Configures a new userRole to restrict access to import project functionality

FEA: ItEr77S05BasicProjectImport
This commit is contained in:
Lorenzo Tilve Álvaro 2013-03-26 17:46:03 +01:00
parent eb696ddc87
commit a9d974e0ce
3 changed files with 9 additions and 3 deletions

View file

@ -46,6 +46,7 @@ public enum UserRole {
// Page roles
ROLE_PLANNING(_("Planning")),
ROLE_TEMPLATES(_("Templates")),
ROLE_IMPORT_PROJECTS(_("Import projects")),
ROLE_WORKERS(_("Workers")),
ROLE_MACHINES(_("Machines")),
ROLE_VIRTUAL_WORKERS(_("Virtual Workers")),

View file

@ -273,9 +273,6 @@ public class CustomMenuController extends Div implements IMenuItemsRegister {
globalView.goToOrdersList();
}
}, "01-introducion.html#id2"));
// In order of see the Import project option in the menu
planningItems.add(subItem(_("Import project"),
"/orders/imports/projectImport.zul", ""));
}
if (SecurityUtils.isSuperuserOrUserInRoles(UserRole.ROLE_PLANNING)) {
planningItems.add(subItem(_("Resources Load"), new ICapture() {
@ -295,6 +292,11 @@ public class CustomMenuController extends Div implements IMenuItemsRegister {
planningItems.add(subItem(_("Templates"),
"/templates/templates.zul", ""));
}
if (SecurityUtils.isSuperuserOrUserInRoles(UserRole.ROLE_IMPORT_PROJECTS)) {
// In order of see the Import project option in the menu
planningItems.add(subItem(_("Import project"),
"/orders/imports/projectImport.zul", ""));
}
if (!planningItems.isEmpty()) {
topItem(_("Planning"), "/planner/index.zul", "", planningItems);
}

View file

@ -117,6 +117,9 @@
access="ROLE_BOUND_USER" />
<intercept-url pattern="/myaccount/monthlyTimesheet.zul"
access="ROLE_SUPERUSER,ROLE_TIMESHEETS,ROLE_BOUND_USER" />
<intercept-url pattern="/orders/imports/projectImport.zul"
access="ROLE_SUPERUSER,ROLE_IMPORT_PROJECTS" />
<intercept-url pattern="/**" access="IS_AUTHENTICATED_FULLY" />