add one more assumption to harness ACL client

jobatzil/rename
Johannes Batzill 2022-09-05 22:29:40 -07:00
parent 3b6f6b8916
commit 4545ffa666
2 changed files with 9 additions and 4 deletions

View File

@ -128,9 +128,13 @@ func checkAclResponse(permissionChecks []*types.PermissionCheck, responseDto acl
* We are assuming two things:
* - All permission checks were made for the same principal.
* - Permissions inherit down the hierarchy (Account -> Organization -> Project -> Repository)
* - No two checks are for the same permission - is similar to ff implementation:
* https://github.com/wings-software/ff-server/blob/master/pkg/rbac/client.go#L88
*
* Based on that, if there's any permitted result for a permission check the permission is allowed.
* Now we just have to ensure that all permissions are allowed
*
* TODO: Use resource name + scope for verifying results.
*/
for _, check := range permissionChecks {

View File

@ -26,10 +26,11 @@ type aclResponseData struct {
}
type aclControlElement struct {
Permission string `json:"permission"`
ResourceScope aclResourceScope `json:"resourceScope,omitempty"`
ResourceType string `json:"resourceType"`
Permitted bool `json:"permitted"`
Permission string `json:"permission"`
ResourceScope aclResourceScope `json:"resourceScope,omitempty"`
ResourceType string `json:"resourceType"`
ResourceIdentifier string `json:"resourceIdentifier"`
Permitted bool `json:"permitted"`
}
type aclResourceScope struct {