How can i introduce my own permission in a plugin - cumulocity

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.

Related

How to show Assign To list for bugs work item?

I'm a tester and my manager has add new team project to the TFS and add my user and a developer user for this team project, when I've tried to add any type of work items the list of "Assigned To" shows all the users correctly, except for the "bug work item" only, I can't assigned to any user and shows that it is not in the list of supported values.
how can I solve this problem?
First, make sure the work item that you're manipulating currently in a state that has a valid transition to New. Otherwise, you will not be able to save the changes.
If you have customized the bug work item type. According to sounds like a rule in the bug workflow or field.
If you run the [witadmin exportwitd] command and export the bug work item type, look for the Assigned To Field and look at the rules on the field. Also take a look at the section and look at the rules for the transitions.
Also take a look at this similar question on TFS2015 Bug/Task unable to assign it to someone else than the user that creates it, try the suggestion mentioned in the link:
needed to give the relevant global top-level permissions for everyone
to view stuff
Just run the below in order to grant the needed rights :
tfssecurity /a+ Server FrameworkGlobalSecurity GenericRead
> "[DefaultCollection]\Project Collection Valid Users" ALLOW
> /collection:http://tfsserver:8080/tfs/DefaultCollection

How to Configure Permissions in 2sxc News App

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

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

Is there an existing concept for handling permission in a vaadin JPAContainer?

I have a vaadin application using JPAContainer an want to implement some sort of access control. The container should filter all entities that the user is not allowed to read and restricts modification to those users explicitly allowed.
My question is now if there is an existing solution to help implementing this. I searched for it and didn't find anything. Not even a discussion or description of a concept. So i assume the answer is "No" and I'm basically asking to provide a better search result for the next one looking for this.
Nevertheless would I be happy if someone points me to something that helps me implementing this properly.
Thanks
Raffael
There is no such a thing in jpacontainer nor in vaadin.
Vaadin applications are secure and safe if say, the "Edit" or "delete" button is not visible, there is no way to hack it. Or you can have the button disabled only, but do not attach a click listener to it if the user has no permission to do it.

Plugin configuration in Eclipse

I'm investigating the use of Eclipse as a platform and I am trying to figure out how a plugin provides configuration. For example, say I have a plugin to display a user defined message. Further, I want that user defined message to be configured by the user. What is the standard way for the user to edit this message in the platform? Is there any documentation for this?
As you mentions in the comments, the article Preferences in the Eclipse Workbench UI described the way developers define preference pages for their plug-ins.
By use of the preference store in conjunction with the preferences dialog and provided field editors a plug-in developer can quickly put together a user interface for managing preferences.
The color preference page is an example of a simple page that uses a single JFace field editor to manage its values
That way, you can define several type of custom values configured by the user:
text field
set of predefined values (dropdown list)
array of values
Example:
Found it: http://www.eclipse.org/articles/Article-Preferences/preferences.htm Wow, Stackoverflow helps a lot! You only need to post and it magically comes up in Google
Sorry to VonC but I had already found it before he posted the answer :-/