-
-
Notifications
You must be signed in to change notification settings - Fork 137
feat: add GetImplicitUsersForResource
and GetAllowedObjectConditions
APIs etc.
#156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Pull Request Test Coverage Report for Build 10439810437Details
💛 - Coveralls |
5ecb589
to
535d0fd
Compare
src/Enforcer.php
Outdated
|
||
$trimPrefix = function ($string, $prefix) { | ||
if (strpos($string, $prefix) === 0) { | ||
return substr($string, strlen($prefix)); | ||
} else { | ||
return $string; | ||
} | ||
}; | ||
|
||
$objectConditions[] = $trimPrefix($policy[1], $prefix); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please simplify this code
$trimPrefix = function ($string, $prefix) { | |
if (strpos($string, $prefix) === 0) { | |
return substr($string, strlen($prefix)); | |
} else { | |
return $string; | |
} | |
}; | |
$objectConditions[] = $trimPrefix($policy[1], $prefix); | |
$objectConditions[] = substr($policy[1], strlen($prefix); |
src/Enforcer.php
Outdated
foreach ($roles as $role) { | ||
$isRole[$role] = true; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please simplify this code:
foreach ($roles as $role) { | |
$isRole[$role] = true; | |
} | |
$isRole = array_flip($rules); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That‘s wonderful😲.
src/Enforcer.php
Outdated
* | ||
* @return array | ||
*/ | ||
public function removeDumplicatePermissions(array $permissions): array |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please define it as a private function.
bb66a6f
to
4762fd6
Compare
4762fd6
to
1a1e389
Compare
I made changes, please review. |
🎉 This issue has been resolved in version 3.24.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
GetImplicitUsersForResource
,GetAllowedObjectConditions
,GetAllDomains
,GetAllRolesByDomain
to RBAC APIGetDomains
,GetAllDomains
to RoleManager APIObjConditionException
andEmptyConditionException