-
Notifications
You must be signed in to change notification settings - Fork 23
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
Admin-scope token or: How to get hidden objects #188
Conversation
…ble-hidden-object-to-admin
$query = Space::find()->visible(); | ||
$query = Space::find(); | ||
|
||
if (!(Yii::$app->getModule('space')->globalAdminCanAccessPrivateContent && Yii::$app->user->identity->isSystemAdmin())) { |
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.
@gevorgmansuryan Perhaps we would be better off using this permission here, instead of the Flag and isSystemAdmin
: https://github.com/humhub/humhub/blob/master/protected/humhub/modules/admin/permissions/ManageSpaces.php
@marc-farre Is the flag globalAdminCanAccessPrivateContent
still required / not deprecated with the new ManageContent
permission?
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.
@luke- the same is used at \humhub\modules\space\models\Space::canAccessPrivateContent too. Change to ManageSpaces
bot and remove globalAdminCanAccessPrivateContent ? Or you mean Yii::$app->user->identity->canManageAllContent()
?
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.
@gevorgmansuryan This endpoint it is only about the Spaces and not about the Contents of the Space.
So I would only check the 'ManageSpaces' permission. Same as in /admin/space
.
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.
@luke- found an issue. fixed
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.
@gevorgmansuryan Hmm, I would expect the current user is automatically used.
Any idea why this is not working here?
$query = Space::find()->visible(); | ||
$query = Space::find(); | ||
|
||
if (!(Yii::$app->getModule('space')->globalAdminCanAccessPrivateContent && Yii::$app->user->identity->isSystemAdmin())) { |
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.
@gevorgmansuryan This endpoint it is only about the Spaces and not about the Contents of the Space.
So I would only check the 'ManageSpaces' permission. Same as in /admin/space
.
#185