How to Configure Permissions in 2sxc News App - permissions

I'm using the 2sxc News App for DNN and I'm trying to figure out how to grant users the ability to add/edit/delete news posts without also granting them the ability to change the layout or edit the module.
I tried to add the "2sxc Designers" role I've read about:
But having that role doesn't seem to change anything.
Am I doing something wrong in setting the "2sxc Designers" role and is this what I need to allow only post manipulation?

This is an advanced use case, and I can't give you the full answer, but basically what you want to do is this:
On the content-type, give the group custom permissions - so that the UI accepts changes by them https://github.com/2sic/2sxc/wiki/concept-permissions
Since the toolbars won't appear for non-editors, you'll have to make this happen in the template. So add some razor to check if people of this role. Then enable edit with Edit.Enable https://github.com/2sic/2sxc/wiki/razor-edit.enable
These blog-posts may also help you: https://2sxc.org/en/blog/post/recipe-create-public-forms-with-2sxc

Related

Is it possible to add pre-defined collections cannot be deleted / edited to Directus

I wonder if I could Directus as a CMS back-end for my huge project.
This requires me to add pre-defined collections that cannot be deleted or edited. Also, I need to prevent users add new collections.
I couldn't find anything in the docs for now; since Directus is not invented the way I want; It is expected to be extendable as much as possible. So I think I need to edit -almost- the whole system.
I hope I can find someone to lead me. Thanks.
The Directus is having a roles & permissions module where you can define who can create/edit/update/read the collections as well as items inside it.
There are 2 default roles:
Admin
Public
Only admins can create & maintain collections. You can add additional roles and define permissions for it. More on roles: https://docs.directus.io/guides/roles.html
You can also ask Directus to skip specific database tables and don't manage those. If you need to read data from skipped tables, you can write custom endpoints.
You can check the Directus setup live at: https://www.directus.app
P.S. I've worked on Directus interfaces and my team is working on API. Let me know if you need more help.

How can i introduce my own permission in a plugin

I would like to write an plugin for the cockpit app. The feature i would like to add includes also an additional item in the drop-down menu. However i also would like to introduce my own permission. If the role of the user has the permission the item in menu will be shown otherwise not. Is this possible at all? And how does at look like? I checked the online documentation but couldn't find anything about it. I hope someone could help me...
The only way to introduce new permissions is through a microservice in its manifest. With purely UI you cannot add those.
As an alternative you could base your plugin on any property of the user. You probably would than want to have a second plugin to set/manage this for a user.

OpenStack Horizon RBAC setting custom permissions

I'm working on customizing Horizon. My goal is to, not only limit access to certain aspects of the dashboard, but also remove these components from the dashboard depending on the user role. So I'm not sure if this is even the right direction to be heading.
I'm trying to understand where it defines permissions, for example on some given Horizon component I can add:
permissions = list(getattr(instances_panel, 'permissions', []))
permissions.append('openstack.roles.admin')
instances_panel.permissions = tuple(permissions)
My question is where are these roles defined? I assume in keystone, and how, if possible, can I reference custom roles for example:
permissions.append('keystone.roles.my_custom_role')
You are on the right track. Try this:
permissions.append('openstack.roles.my_custom_role')

Change Theme based on user roles Liferay

I want such a mechanism that will provide different themes depends on different user roles in Liferay.Is there a way that provide me a solution that i can change theme on User roles.
Secondly i want to know that is this is possible programatically or Liferay provides custom supports with this.
any help will be greatly appreciated.
Bad choice
The right way is not to change the theme but to inject something in the page to alter the style.
It's a bad idea to change the theme at runtime depending on the user session. Poor performance due to the invalidated cache every request.
Build a custom portlet and inject it into the theme for every page. Depending on user logic that portlet can inject some javascript to alter css class of html tag.
Is it clear?
Theme is associated with layout (i.e. page). This can be observed in Layout table of liferay. So, even it can be changed using API, but not something that is different at user level, but its associated at page level.
For your requirement, If you have some fixed number of themes, then having different Sites each having one particular theme been applied.
Using Post login hook, you can check for user role and redirect to appropriate site.
Having this approach you can have completely different layout and pages as well depending on user role if you wish you.
We can also use velocity variables such $is_male, $is_female, $time_zone, $language.. to identify user group and can load different CSS file or a parent class in body tag.
Answer might be not useful for Mark who has raised this but future reader might find this useful.
Thanks

Drupal 6: How do I allow a specific role to edit only content of a specific type?

On a Drupal 6 site, I have a 'moderator' role, who worka with an 'article' content type.
I want the moderators to be able to see the list of published/unpublished articles, and have the option to edit the articles (and change their 'published' status).
I do not want, however, for moderators to be able to edit (or see the list of) any other type of content.
If I give moderators the permission to 'administer nodes' I cannot stop them from editing other content types. If I remove that permission, they cannot access the content list (which is crucial for them).
Any ideas?
You might want to check out the Views Bulk Operations Module (http://drupal.org/project/views_bulk_operations). You should be able to use this module to build a custom view that displays only the content types you want the 'moderator' role to edit.
If you all your content types are created with CCK you can unset each content type's permissions for moderators. If not, I'd recommend you do create them in CCK :)
you definitely don't want to give them "administer nodes" permissions since it's a huge can of worms. if the nodes are unpublished you'll need to use the views module to get listings that will let them see the nodes.
that said unless the node type is one created by a specific contrib module you should be able to set the permissions on a per-role basis. if not you might look at using a node access module to control permissions.