-
Notifications
You must be signed in to change notification settings - Fork 175
Concept Set Snapshots/Locking/Unlocking feature #2434
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
base: master
Are you sure you want to change the base?
Conversation
…cept sets (which were created before the lock feature was introduced with a new permission per concept set entity)
Let's follow the existing database migration pattern for creating permissions. There are 2 forms: 1: You just have new permissions:, example here. In this example, we create the tables, (if necessary) insert the new permissions into sec_permission, then assign those permissions to roles. 2: Copying permissions or updating existing permissions some way, example here. In this example, we're creating a temp table In another example (here), we're building a set of permissions based on another permission that is associated to Both these examples have PRs associated to them (check the commit) which will explain the rationale for the change. It's very important that we follow existing patterns about solving a particular problem in the codebase (in this case, creating permissions through a series of insert statements vs. what you implemented which appears to use cursors and loops). This is so that there is a common understanding and approach for solving a problem that is recognizable when we are looking at a particular piece of code. You don't need to check for the existance of a permission because there is a unique constraint set up on the sec_permission.value column, which will lead to a migration failure if the permission already exists. |
Hi @chrisknoll , thank you for the review and the examples with the standard approach to such migrations. I've changed it to use the temp table and tested by manually removing a conceptset:%s:snapshot:post permission and it`s role mapping for one of the concept sets and that SQL executed as a separate migration file inserted it back successfully. This means that for a fresh deployment my migration is expected to enrich each user's permissions for each concept set which has a conceptset:%s:update permission to have also a similar conceptset:%s:snapshot:post permission, that would allow snapshot actions for non-admin users who are owners of their existing concept sets (created before the lock feature was deployed - the snapshot button would be visible to them as well as the new snapshot action api operation). |
b308814
to
4fe8d02
Compare
Thanks @oleg-odysseus . It sounds like you were doing the Option 2 which is a copy permission use-case which makes sense. thanks for making the update. |
No description provided.