mirror of
https://github.com/documize/community.git
synced 2025-07-20 05:39:42 +02:00
Remove group permissions on delete event
This commit is contained in:
parent
1c4a4424e5
commit
359e0e29eb
7 changed files with 236 additions and 142 deletions
|
@ -289,3 +289,13 @@ func (s Scope) DeleteSpaceCategoryPermissions(ctx domain.RequestContext, spaceID
|
|||
|
||||
return b.DeleteWhere(ctx.Transaction, sql)
|
||||
}
|
||||
|
||||
// DeleteGroupPermissions removes all roles for the specified group
|
||||
func (s Scope) DeleteGroupPermissions(ctx domain.RequestContext, groupID string) (rows int64, err error) {
|
||||
b := mysql.BaseQuery{}
|
||||
|
||||
sql := fmt.Sprintf("DELETE FROM permission WHERE orgid='%s' AND who='role' AND whoid='%s'",
|
||||
ctx.OrgID, groupID)
|
||||
|
||||
return b.DeleteWhere(ctx.Transaction, sql)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue