mirror of
https://github.com/documize/community.git
synced 2025-08-02 20:15:26 +02:00
refactored permission code
This commit is contained in:
parent
c12c000ef3
commit
6a651770b5
24 changed files with 753 additions and 632 deletions
|
@ -20,6 +20,7 @@ import (
|
|||
"github.com/documize/community/domain"
|
||||
"github.com/documize/community/domain/mail"
|
||||
"github.com/documize/community/model/account"
|
||||
"github.com/documize/community/model/permission"
|
||||
"github.com/documize/community/model/space"
|
||||
"github.com/documize/community/model/user"
|
||||
)
|
||||
|
@ -61,7 +62,7 @@ func inviteNewUserToSharedSpace(ctx domain.RequestContext, rt *env.Runtime, s *d
|
|||
return
|
||||
}
|
||||
|
||||
perm := space.Permission{}
|
||||
perm := permission.Permission{}
|
||||
perm.OrgID = sp.OrgID
|
||||
perm.Who = "user"
|
||||
perm.WhoID = userID
|
||||
|
@ -70,7 +71,7 @@ func inviteNewUserToSharedSpace(ctx domain.RequestContext, rt *env.Runtime, s *d
|
|||
perm.RefID = sp.RefID
|
||||
perm.Action = "" // we send array for actions below
|
||||
|
||||
err = s.Space.AddPermissions(ctx, perm, space.SpaceView)
|
||||
err = s.Permission.AddPermissions(ctx, perm, permission.SpaceView)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue