AddPermissionForUserCtx adds a permission for a user or role with context support. Returns false if the user or role already has the permission (aka not affected).
(ctx context.Context, user string, permission ...string)
| 101 | // AddPermissionForUserCtx adds a permission for a user or role with context support. |
| 102 | // Returns false if the user or role already has the permission (aka not affected). |
| 103 | func (e *ContextEnforcer) AddPermissionForUserCtx(ctx context.Context, user string, permission ...string) (bool, error) { |
| 104 | return e.AddPolicyCtx(ctx, util.JoinSlice(user, permission...)) |
| 105 | } |
| 106 | |
| 107 | // AddPermissionsForUserCtx adds multiple permissions for a user or role with context support. |
| 108 | // Returns false if the user or role already has one of the permissions (aka not affected). |