I want to hide a button on the ribbon for all users except System Admin and I do not want to write javascript to check the security role of the logged in users. Is there any out-of-box way I can achieve this?
Also is there any entity that only admin has access to which I can use to hide show the button?
Yes, you can achieve this without code.
One option is using MiscellaneousPrivilgeRule under display rules and making sure to pick some privilege like Publish Duplicate Detection Rules which may not be given to non-Admin roles.
Read more
There’s no OOB entity for that purpose, you can identify one in your system or create a dummy entity for that purpose.
Yes you can try this option.
Create a Custom Entity (Custom Button Privelege)
By default only Sys Admin/Cust role will have Privelege to do CRUD operation.
In the custom button -> Display Rule. Set a Entity Privelege Rule based on the custom entity.
Now the button will be visible only for the Admin users & will be hidden for other users.
Similarly we can modify the security role for others as well.
Related
Is it possible to set custom view as default for security role?
Not really. System views are nowhere related to be driven by security roles like forms/dashboards. The closest one can be either keep the view in a Dashboard and the dashboard can be controlled by security role. Read more
Otherwise, create Personal view to share with a Team, for each security role need - create a Team (1-1) for easy mapping/sharing.
I created a multi-tenant application where each tenant have different set of users. I am trying to implement a functionality where same user might exist in different tenants. Does outsystems provide such functionality or I have to create my custom logic ?
Right now, I did create a user having same username in 2 different tenants and during login I am showing user to select tenants. But on changing tenants and logging to that tenant, the environment doesn't switch to that tenant that user has selected.
Below is the image of the logic of switching tenants and logging in the customer.
During debugging I saw that after executing TenantSwitch action it did change the Site.TenantID property but after User_Login action is reverted to the first tenant not the one user selected.
When you use User_Login(), the system will log you in the first Tenant it finds in the DB that has that username, thus ignoring your TenantSwitch().
So, if you want to login to a specific Tenant in your case, you need to be more explicit and instead use the Login() action - after the tenant switch.
For a thorough explanation of this, with example code, please check out the following deepdive Master Class on Multi-Tenancy starting around the 27:20 minute mark.
This isn't available out of the box as OutSystems assigns users (and all entities) to a specific tenant. Entities belonging to single tenanted modules are assigned to the default tenant.
OutSystems uses a hidden .Tenant_Id attribute on each entity to indicate which tenant that user belongs to. You can unhide this attribute for the users entity by selecting it, clicking More... and then ticking the relevant box in the Advanced tab. You can then access the attribute directly, but be aware this will hinder OutSystems' ability to do some of the stuff it does automatically to ensure that you access tenant specific data.
When you use the User_Login action OutSystems will deduce which tenant to use from the User.Tenant_Id attribute regardless of which tenant you've switched it to previously. The user would need an account for each tenant they need to use, but there's no reason this couldn't be done behind the scenes with OS fetching the correct username before logging in. You'd need to ensure they all stay in sync though, especially the passwords ofc.
By default, Magento shows different widget types as options in the backend, such as 'Cms Page Link' and 'Catalog Category Link'. However, I want to provide my client only with the theme's relevant widgets, so I want to be able to remove some widgets, at least as an admin option.
The options for the backend are set via the respective core modules /etc/widget.xml. What is the best way to override this, without a core hack?
Any suggestion would be much appreciated!
#Daco
Magento has features to implement the above. It is achieved with the help of "ROLES" and "USERS" in the system tab of magento admin panel.
Solution
Create a role for your client "client_xyz" by going to
System->Permission->Roles.
Add Resources to the role, these resources are the links that you
would like to restrict the users upon or grant them permissions.
After creating the roles and resources, create a user to be given to the client. The Users can be created under System->Permissions->Users.
Create the users assign the roles that are already created. And now when the users login using this newly created credentials. They will only see what is granted by the Admin.
When creating a new account from the front-end I'd like the user to be able to choose a user group in which to register (joomla 2.9). How do I expose the groups I created in the back-end into a registration form, for the users to choose one when registering? Thanks.
Well, you can just add the field to your form but the problem is that you would not want to show all of the groups since then people could select super admin or admin.
So what you need to do instead is make a custom field that is more selective.
I created a workflow . My workflow sends e-mails to users who has salesperson security role. But I have big problem. After I export and import customizations in different company users of old company are shown on the e-mail template. How can I create a worflow which sends e-mail to users who has selected security role.
Regards,
Erdogan Uslu
The workflow editor isn't that powerful. You can't select a bunch of users with certain attributes and apply an action to them. You'll have to create a custom workflow activity. Run as the admin user to retrieve the list of users with a certain role. Base it off the SDk article Retrieve the Roles for a User
You would need to reverse this expression, so to speak. Add a condition expression on the role link, to match on the role name. Then you would remove the condition expression from the system user link. Make the role link a child of the system user link (right now the systemuser is a child of the role link). Change qe.EntityName to "systemuser".
You'll then need to create an e-mail. See SDK articles on sending e-mail and creating workflow activities. Hope this helps.
Using a security role like that is quite a weak mechanism for grouping users. CRM has the concept of a Team. Can't you create a Team, then send your email to the team?