Quantcast
Channel: SQL Server Master Data Services forum
Viewing all articles
Browse latest Browse all 1311

How can we restrict the other user to change the record which has been entered by particular user in MDS

$
0
0

I have created Product entity in MDS. It's having the following values:

Name  Code  Owner

Bike    1      ABC

Car      2     XYZ

Cycle   3     RRR

owner XYZ can change the record of RRR. But if owner XYZ or any other owner in this entity tried to update the ABC's record, access should be denied. That means, no one should have the permission to change the records which are entered by ABC.

For this i have executed this code

CREATE TRIGGER mdm.party_trial_readonly ON mdm.tbl_1042_1278_EN AFTER UPDATE, DELETE AS
IF EXISTS (SELECT * FROM deleted WHERE readonly = 1)
BEGIN
   ROLLBACK TRANSACTION
   RAISERROR ('Attempt to change a read-only row', 16, 1)
   RETURN
END;

After executing this code i couldn't edit any of the records.

Please help me out in this.



Viewing all articles
Browse latest Browse all 1311

Trending Articles