Skip to content
This repository has been archived by the owner on Nov 26, 2017. It is now read-only.

Fix category field to correctly manage edit.state permissions in combina... #722

Closed
wants to merge 2 commits into from

Conversation

elinw
Copy link
Contributor

@elinw elinw commented Jan 7, 2012

Fix category field to correctly manage edit.state permissions in combination with other permissions.

Currently when a user has edit for an item but not edit.state the category field returns a blank list of options. There are also situations where the user may have create in other categories but not edit.state in the category of the current item. In that case (contrary to current behavior) the option to change category should not be given but only the current category should be shown.

@joomla-jenkins
Copy link

Unit testing complete. There were 0 failures and 0 errors from 1971 tests and 11146 assertions.
Checkstyle analysis reported 199 warnings and 0 errors.

@joomla-jenkins
Copy link

Build triggered by changes to the head.

Unit testing complete. There were 0 failures and 0 errors from 1971 tests and 11146 assertions.
Checkstyle analysis reported 199 warnings and 1 errors.

@elinw
Copy link
Contributor Author

elinw commented Jan 9, 2012

I actually want to add that I don't know if this belongs in the platform except to the extent that it already integrates permissions. I'm not sure that category by itself shouldn't just be a list of categories and then somehow the user can apply permission rules to it. But it is what it is right now, it's paying attention to some permissions but not others and that is making it broken for the ways that it is used. Part of me thinks that the cms should just have its own field extended from the base category field that works in ways that make sense in context.

// unless the item is already in that category.
// Unset the option if the user isn't authorised for it. In this field assets are always categories.
if ($user->authorise('core.create', $extension . '.category.' . $option->value) != true)
foreach ($options as $i => $option) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The opening curly brace should be on a new line.

@elinw elinw closed this Jan 14, 2012
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants