This commit is contained in:
withchao
2023-01-29 18:13:02 +08:00
parent 16fa05f76e
commit 0a81dd040f
4 changed files with 118 additions and 107 deletions
+7
View File
@@ -18,10 +18,17 @@ type GroupInterface interface {
DeleteGroupByIDs(ctx context.Context, groupIDs []string) error
TakeGroupByID(ctx context.Context, groupID string) (group *relation.Group, err error)
GetJoinedGroupList(ctx context.Context, userID string) ([]*relation.Group, error)
GetGroupMemberList(ctx context.Context, groupID string) ([]*relation.GroupMember, error)
GetGroupMemberNum(ctx context.Context, groupIDs []string) (map[string]int, error)
GetGroupOwnerUserID(ctx context.Context, groupIDs []string) (map[string]string, error)
CreateGroupMember(ctx context.Context, groupMember []*relation.GroupMember) error
CreateGroupRequest(ctx context.Context, requests []*relation.GroupRequest) error
//mongo
CreateSuperGroup(ctx context.Context, groupID string, initMemberIDList []string) error
AddUserToSuperGroup(ctx context.Context, groupID string, userIDs []string) error
GetSuperGroupByID(ctx context.Context, groupID string) (superGroup *unrelation.SuperGroup, err error)
}
+4
View File
@@ -173,6 +173,10 @@ func CheckAccessV3(ctx context.Context, ownerUserID string) (err error) {
return constant.ErrIdentity.Wrap(utils.GetSelfFuncName())
}
func IsAppManagerUid(ctx context.Context) bool {
return utils.IsContain(tools.OpUserID(ctx), config.Config.Manager.AppManagerUid)
}
func CheckAdmin(ctx context.Context) error {
if utils.IsContain(tools.OpUserID(ctx), config.Config.Manager.AppManagerUid) {
return nil