AccessControl: Only return action and scope for user permissions and make them unique (#48939)

* Only return action and scope for user permissions and make them unique
This commit is contained in:
Karl Persson
2022-05-12 17:15:18 +02:00
committed by GitHub
parent 6cbaa18cf6
commit 1c679e814b
2 changed files with 4 additions and 7 deletions

View File

@@ -21,7 +21,7 @@ type AccessControl interface {
// Evaluate evaluates access to the given resources.
Evaluate(ctx context.Context, user *models.SignedInUser, evaluator Evaluator) (bool, error)
// GetUserPermissions returns user permissions.
// GetUserPermissions returns user permissions with only action and scope fields set.
GetUserPermissions(ctx context.Context, user *models.SignedInUser, options Options) ([]*Permission, error)
// GetUserRoles returns user roles.
@@ -40,6 +40,7 @@ type AccessControl interface {
}
type PermissionsProvider interface {
// GetUserPermissions returns user permissions with only action and scope fields set.
GetUserPermissions(ctx context.Context, query GetUserPermissionsQuery) ([]*Permission, error)
}