-
Notifications
You must be signed in to change notification settings - Fork 291
N°9723 - IsActionAllowed should work with non instantiated users objects #947
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
The head ref may contain hidden characters: "issue/N\u00B09723-IsActionAllowed-should-work-with-non-instantiated-users-objects"
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -81,6 +81,17 @@ protected function CreateUniqueUserAndLogin(string $sLoginPrefix, int $iProfileI | |
| return $oUser; | ||
| } | ||
|
|
||
| public function testIsActionAllowedWithNonInstantiatedUserObject() | ||
| { | ||
| $oUser = $this->GivenUserWithProfiles('test1', [self::$aURP_Profiles['Configuration Manager']]); // not a readonly profile | ||
| $oAdminUser = $this->GivenUserWithProfiles('test2', [self::$aURP_Profiles['Administrator']]); | ||
| $oAdminUser->DBInsert(); | ||
| $_SESSION = []; | ||
| UserRights::Login($oAdminUser->Get('login')); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. any reason why you have to log in in this test?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because IsActionAllowed method starts with So without login, the test isn't relevant |
||
|
|
||
| self::assertTrue(UserRights::IsActionAllowed('Server', UR_ACTION_MODIFY, null, $oUser) === UR_ALLOWED_YES); | ||
|
odain-cbd marked this conversation as resolved.
|
||
| } | ||
|
|
||
| /** | ||
| * @param array $aProfileIds | ||
| * @param array $aShouldBeAllowedToSeeClass | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.