3
0

Fix comments on permissions Check() function

This commit is contained in:
Denis Arh
2019-05-20 15:37:16 +02:00
parent 68387f6bd2
commit 0bf5d5d24f

View File

@@ -3,12 +3,11 @@ package permissions
// Check verifies if role has access to perform an operation on a resource
//
// Overall flow:
// - no roles, no access
// - invalid resource, no access
// - can this specific role perform an operation on this specific resource
// - can this specific role perform an operation on any resource of the type (wildcard)
// - can anyone perform an operation on this specific resource
// - can anyone perform an operation on any resource of the type (wildcard)
// - can this combination of roles perform an operation on this specific resource
// - can this combination of roles perform an operation on any resource of the type (wildcard)
// - can anyone/everyone perform an operation on this specific resource
// - can anyone/everyone perform an operation on any resource of the type (wildcard)
func (set RuleSet) Check(res Resource, op Operation, roles ...uint64) (v Access) {
if !res.IsValid() {