Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RowPermissions DenyInsert/Update #325

Open
gbanusi opened this issue Mar 20, 2020 · 1 comment
Open

RowPermissions DenyInsert/Update #325

gbanusi opened this issue Mar 20, 2020 · 1 comment
Labels
question Further information is requested

Comments

@gbanusi
Copy link

gbanusi commented Mar 20, 2020

Hi!

I would like to know is there any way to distinguish insert and update in DenyWrite RowPermission concept? Any example somewhere?

Thanks!
Greg

@bantolov
Copy link
Collaborator

Hi,
Row permissions in Rhetos are not intended for this kind of features. RP rules can only be specified as a filter that will be applied on all data modifications (insert, update and delete).

This feature could be implemented in custom C# code: you can add custom code to Save method with one of the SaveMethod concepts (see examples on wiki page), or preferably develop a new custom concept with similar behavior.

You could add this code perhaps at OldDataLoaded position (after initialization, but before saving to database). Use insertedNew and updatedNew lists to check the inserted and updated records. Use _executionContext.UserInfo.UserName to get the current user that is executing this save operation.

@bantolov bantolov added the question Further information is requested label Mar 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants