User tests: Successful: Unsuccessful:
When Super User creates a new category, the default state for the status attribute is published. However, when a non super user with r/w access for com_content creates a new category, during creation, the field attributes are disabled. As a result, the user is unable to set the state field and the newly created category ends up with status unpublished. Next the user can modify the status by selecting the category for edit.
Also for the newly created category, authorisation is looked up based on the category id. However, for the new category, an id does not exist yet and hence the fields are disabled, for every user which is not Super User.
This fix checks if id does exist and if not (new category), disabling is skipped. If a user is allowed to create a new category, the user should be able to define the relevant fields.
I think it is strange that there is not any means for a non super user to create and publish a new category in one go. Here I am referring specifically to category creation. I think the pattern you describe, regarding the default permissions, refers only to front end creation. I don't know if it is possible to create categories via the front end, but I am not an expert.
Furthermore if you look at the default permissions, both Editor and Publisher are allowed to edit state.
I like the suggestion about checking the ACL of the parent category. However, I think if a group is provided (sufficient) access to com_content (state, create, delete, etc.), a member should just have that access (if not disallowed on a more specific level) and access inherited from a parent should go through permissions set on category items itself.
Last but not least, I don't think it is possible to inherit parent information during creation of a category, or am I wrong here? Is this different in Joomla 3 ?
I don't know if it is possible to create categories via the front end, but I am not an expert.
I also don't think it's possible to do from frontend. That may change however in future if someone provides that function.
Furthermore if you look at the default permissions, both Editor and Publisher are allowed to edit state.
Looking at default permissions for com_content. Editors and Authors are not allowed to edit states by default. Publishers are allowed.
Last but not least, I don't think it is possible to inherit parent information during creation of a category, or am I wrong here? Is this different in Joomla 3 ?
You should be able during the saving process, but it's obviously not possible during the loading of the empty form, except if you pass the parent category already. If no parent category is given, then the component settings should be used.
So in this case, you should show the state field if either the category ACL (during edit) or the extension ACL (during creation) allows it.
Looking at default permissions for com_content. Editors and Authors are not allowed to edit states by default. Publishers are allowed.
Yes you are completely right, my mistake I mixed things up here.
So in this case, you should show the state field if either the category ACL (during edit) or the extension ACL (during creation) allows it.
It is so simple/clear after you have written this down. I see if I can figure this out.
It is so simple/clear after you have written this down. I see if I can figure this out.
I hope it's that simple myself. It is in theory. In practice there is always something making it more complicate
Status | New | ⇒ | Pending |
Labels |
Removed:
?
|
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-01-01 13:02:47 |
Closed_By | ⇒ | brianteeman |
Thanks for working on this. Unfortunately this did not make it into the final release of Joomla 2.5, or it was handled elsewhere, so this is being closed. If you feel this is still a valid issue in Joomla 3 please create a new issue.
Closed_Date | 2015-01-01 13:02:47 | ⇒ | 2015-01-01 13:02:48 |
Create permissions don't necessary mean you are allowed to change the state. In fact the default permissions are that authors and editors can create, but not publish an article. Managers can do that then.
For a new category, you would need to check the ACL of the parent category, or the component settings.