eparamo
(Eduardo Paramo)
September 30, 2021, 3:52am
#1
I have my role created and assigned to the logged in user… in that main menu I want to hide these 2 buttons.
@Override
@ScreenComponentAccess (screenId = “ambiente_PublicoMainMenu”, deny = {“btnNuevaSolicitud”, “btnMisSolicitudes”})
public ScreenComponentPermissionsContainer screenComponentPermissions() {
return super.screenComponentPermissions();
}
It doesent seem to work. Copuld anyone please help me?
thank you !
firstova
(Natalia Firstova)
September 30, 2021, 1:23pm
#2
Hi.
Could you please provide more information about your problem? Which version of the platform do you use? Do you set up the role using Studio Role designer? If it is possible, could you share a small project to help us investigate the problem?
Regards,
Natalia
eparamo
(Eduardo Paramo)
September 30, 2021, 2:52pm
#3
Hi, Thank you for your response.
Just create a new project add a extMain screen put a button btnHideMe
create this role
@Role (name = TestRole.NAME)
public class TestRole extends AnnotatedRoleDefinition {
public final static String NAME = “TestRole”;
@ScreenComponentAccess(screenId = "extMainScreen", deny = {"btnHideMe"})
@Override
public SpecificPermissionsContainer specificPermissions() {
return super.specificPermissions();
}
}
create an account with minimal access and assign that role
log in and the button is still there… I dont want to see it for the test role.
How can I achieve this?hideComponentSecurity.zip (85.9 KB)
firstova
(Natalia Firstova)
October 1, 2021, 11:14am
#4
You use the wrong method and Studio shows you intention about it:
Here is the example of the right method:
@ScreenComponentAccess(screenId = "extMainScreen", deny = "testBtn")
@Override
public ScreenComponentPermissionsContainer screenComponentPermissions() {
return super.screenComponentPermissions();
}
firstova
(Natalia Firstova)
October 11, 2021, 1:20pm
#6
Here is your demo project, everything works fine for me hideComponentSecurity.zip (86.0 KB)
Please check the Role settings.