MODx removing content resource field - content-management-system

How do I hide the content resource field from non-admin users?

So you'd like a user to be able to change document fields such as title, alias etc but not the content?
You can not lock individual fields to admin user (as far as I know). You can either lock the whole page/resource or you could put the content that you want to be locked into the template for that document and lock the template to only the admin user which would achieve the same effect.
Make sure you don't have a reference to [+content+] in the template and even if the user enters document content it won't impact the page.

New answer instead of editing the above as this is a much cleaner solution.
Create different user groups eg. Admin & Editor
Make sure admin is in the admin user group
Create a template variable for your content and in the Access Permissions section only tick the admin group.
Assign the TV to your template.
Now if the user isn't in the admin user group the TV won't even be visible when they are editing the resource.

Hey, thanks for the answer.
I thought I'd post what I ended up doing.
With MODx Evo 1+, you have managermanager included. After removing the included file(which is used rather than the default chunk) using the rules in there I can rename hide and sync content.

Related

Typo3 user rights are inherited incorrectly

I am trying to create user rights in Typo3 7.6 so that a user can simply work as an editor. He has, for his department, a section of the page tree. In that he can almost exclusively create text & media. For a single subpage of this whole tree, it also requires the ability to create an HTML element.
From my personal logic, it would be sufficient to create a user group (A), with all the usual rights would be covered. So creating pages, texts and media. A second user group (B) then only with the explicit permission to create HTML elements. Under Access, I have selected the group in the entire page tree as a simple editor (A), under which one page may be on the HTML, but the second user group (B).
But now it seems that as soon as the user receives the group B, it is not only allowed to create HTML for the one page, but the entire page tree.
What am I doing wrong? How is that otherwise thought?
This doesn't work this way. The permissions of all groups are combined and are the same on any page.
A possible solution could be to use the extension content_defender and a different backend layout for those pages where the HTML element is allowed.
Just as a side note: Allowing an editor the HTML element is a security risk as the editor can also create JavaScript and with that can get admin permissions and other stuff. So I would be very careful with that and would avoid allowing this element for admins.

Adding additional information to user accounts in Trac

For my Trac plugin, I would like to add a color (as string or rgb values) to each user for use from somewhere else in the plugin. The color should be configurable via the admin page.
Is it possible to add another column to the table in the Users settings of the AccountManagerPlugin panel, and if it is, how do I add the information to the database so I can access it from elsewhere?
Another option would be to make a new Admin Panel for my plugin, which is what I am currently doing, with a table with just the user names and their colors. But in this case, although I already have the empty admin panel, I don't know how to add the table and add new items to the database.
To explain what I need the colors for:
My plugin adds a new export option for tickets, and formats them with my own html and css structure. The tickets contain the owner's name, and this name should be displayed with their respective colors. The code for this already exists, now I just need to retrieve the colors from the database, and beforehand save them to the database via the admin panel.
The colors should be changable only via the admin page.
There's no Users admin panel in Trac, however the AccountManagerPlugin has a User management panel. Let me know if you are using the AccountManagerPlugin and I'll provide more info on that.
Keeping the discussion within the scope of Trac, you could implement the ability for the user to make a selection through a preference panel by implementing IPreferencePanelProvider. You could save the value in the session_attribute table and make use of it anywhere else. For an attribute named user_color, the value can be retrieved using req.session.get('user_color').
Examples can be found in trac.prefs.web_ui. I've linked to the code in Trac 1.1.6 because the module was refactored so that the preferences were more modular #9162.

Hide typo3 content elements for specific user(groups)

I want to "hide/deactivate" the table element for specific users/usergroups in the typo3 BE.
Or to be more clear: I want to ONLY allow it to ONE specific user (admin).
How can i do that?
NOTE: At the moment the table element is deactivated in the global TS-config via tt_content removeItems().
TIA
Note: I have only an old Typo3 4.3.5 installation, but I hope this hasn't changed much.
In User admin, edit group permissions and go to Access lists. At the bottom is "Explicitly allow/deny field values" where you can restrict specific content types.
With the restriction, affected users still see the restricted content element in BE, but get a message when trying to edit it.

How to hide a page based on the logged-in user in CQ5?

I want to hide a page in navigation component based on the logged in user. I have two approaches in mind. Set permissions on the page's node in CRX-DE; denying it for all users; and then allowing it for specific groups. I have been trying it; not found much success. Else; I can get the id of the logged in user in the jsp and based on the user group; I can set the page's property 'Hide in Navigation' . But I am not able to find how to set that property in jsp. Please suggest.
Edit:
I am using the default authentication.I wanted to hide a page from navigation in the default 'list' component. If I use CUG; the users belonging to that group will still be able to see that particular page's link in the list component; and would be asked for login on clicking on that page.I want the link itself to be hidden if the user belonged to a particular group
Thanks.
If you are using the default authentication features in AEM (like Geometrixx), which rely on users that exist in AEM, you can use Closed User Groups. CUG allows you to set what users or groups can or cannot see a specific page. You can see where to set CUGs in the page properties dialog for each page. I'm pretty sure CUG settings inherit down the page hierarchy as well.
Using the JCR permissions for this is a good deal more complex, because it's such a low-level architectural thing. However, for more complex solutions, sometimes it's a necessary part of the equation.
I agree with ryanluka that going for JCR permissions should be avoided when the problem can be solved by much simpler approach. I modified the list.jsp of the default list component. Extracted the login user's id using Userpropertiesutil; and based on the group; wrote the code in jQuery to remove that particular page's div from list component.

Administrator has no admin bar for specific pages

I have an issue with a dotnetnuke 7 site, where the administrator cannot edit a minority of the pages.
When logged in and on such a page, the edit page menu missing.
When on the page management view, there are only options to view or make homepage. On clicking, properties are not shown.
What could be causing this?
Cheers, mark
I've seen in the past where the Administrator Role Id is incorrectly defined in the database.
Unfortunately there isn't a UI way to change this, you'll need to go into the DB to see what Role ID is defined. I believe AdministratorRoleID is stored either in the Portals table, or in the PortalSettings or PortalLocalization table. Check the # and see if that matches the ID of the Administrators role for that portal.
It could also be a CSS issue if it only affects some pages. Can you try changing the skin on those pages to the default skin and try again...
Just noticed this old question, so I thought that I'd update with what the actual problem was.
We imported pages using a direct to database program - we naturally assumed that the site administrator could, as a default be able to edit pages within their own site.
As it turns out, DNN actually creates correct access rights to each page as they are created, and rights are added and removed as required. This means that if you create pages you must directly create access rights for the correct site administrator.
Kind Regards, Mark, IA