Skip to content

Commit

Permalink
fix: anonymous permission
Browse files Browse the repository at this point in the history
  • Loading branch information
fumiama committed Mar 1, 2023
1 parent 85e9beb commit 3150b30
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,13 +229,12 @@ func SuperUserPermission(ctx *Ctx) bool {

// AdminPermission only triggered by the group admins or higher permission
func AdminPermission(ctx *Ctx) bool {
return SuperUserPermission(ctx) || ctx.Event.Sender.Role != "member"
return SuperUserPermission(ctx) || ctx.Event.Sender.Role == "owner" || ctx.Event.Sender.Role == "admin"
}

// OwnerPermission only triggered by the group owner or higher permission
func OwnerPermission(ctx *Ctx) bool {
return SuperUserPermission(ctx) ||
(ctx.Event.Sender.Role != "member" && ctx.Event.Sender.Role != "admin")
return SuperUserPermission(ctx) || ctx.Event.Sender.Role == "owner"
}

// UserOrGrpAdmin 允许用户单独使用或群管使用
Expand Down

0 comments on commit 3150b30

Please sign in to comment.