Jake
05/06/2022, 5:43 PMJoey
05/06/2022, 5:46 PMnshttpd
05/06/2022, 5:48 PMdantheman
05/06/2022, 7:44 PMwilliamdclt
05/06/2022, 8:04 PMJoey
05/06/2022, 8:04 PMJoey
05/06/2022, 8:04 PMJoey
05/06/2022, 8:05 PMJoey
05/06/2022, 8:05 PMwilliamdclt
05/06/2022, 8:12 PMJoey
05/06/2022, 8:14 PMJoey
05/06/2022, 8:14 PMwilliamdclt
05/06/2022, 8:32 PMyetitwo
05/06/2022, 9:13 PMyetitwo
05/06/2022, 9:15 PMecordell
05/06/2022, 9:16 PMecordell
05/06/2022, 9:16 PMecordell
05/06/2022, 9:17 PMcrafterix
05/09/2022, 9:53 AM// Roles
permission guest = assignees & company->guest;
permission member = assignees & company->member;
permission admin = admins + company->admin;
permission at_least_member = member + admin;
permission at_least_guest = guest + at_least_member;
permission access = at_least_guest;
or
permission access = (task->access & project->at_least_member) + (creator & project->member);
crafterix
05/09/2022, 10:05 AMJoey
05/09/2022, 7:30 PMshubhamsinha
05/10/2022, 10:58 PMdefinition alert {
relation company: company
relation user: user
permission update_alert = user
permission delete_alert = company
permission get_alert = company
permission get_metric_alert_history = company
}
The use case is that anyone in the company can delete an alert , get alert details and get alert history. However, only the user that created the alert can update it. Does this mean that when an alert is created I need to create two sets of permissions: One with the company and another one with the user? Is there a better way to write the schema?Jake
05/10/2022, 11:18 PMdefinition user {}
definition company {
relation user: user
}
definition alert {
relation creator: user
relation company: company
permission update_alert = creator
permission delete_alert = company->user
permission get_alert = company->user
permission get_metric_alert_history = company->user
}
Jake
05/10/2022, 11:19 PMJake
05/10/2022, 11:21 PM/** More denormalized, assumes the all users belong to only one company, and you can infer an alert's company by its creator user */
definition user {
relation company: company
permission company_users = company->user
}
definition company {
relation user: user
}
definition alert {
relation creator: user
permission update_alert = creator
permission delete_alert = creator->company_users
permission get_alert = creator->company_users
permission get_metric_alert_history = creator->company_users
}
Jake
05/10/2022, 11:22 PMshubhamsinha
05/10/2022, 11:33 PMJake
05/10/2022, 11:33 PMshubhamsinha
05/10/2022, 11:35 PMLemmeCode
05/11/2022, 1:40 AM