Bug #1547: Allow user with role SUPERUSER to create new projects
FEA: ItEr77S04BugFixing
This commit is contained in:
parent
f0ebe2f896
commit
07ca5fd443
4 changed files with 10 additions and 6 deletions
|
|
@ -1439,7 +1439,8 @@ public class OrderCRUDController extends GenericForwardComposer {
|
|||
* the create buttons accordingly.
|
||||
*/
|
||||
private void checkCreationPermissions() {
|
||||
if (!SecurityUtils.isUserInRole(UserRole.ROLE_CREATE_PROJECTS)) {
|
||||
if (!SecurityUtils
|
||||
.isSuperuserOrUserInRoles(UserRole.ROLE_CREATE_PROJECTS)) {
|
||||
if (createOrderButton != null) {
|
||||
createOrderButton.setDisabled(true);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -771,7 +771,8 @@ public class OrderModel extends IntegrationEntityModel implements IOrderModel {
|
|||
return true;
|
||||
}
|
||||
if (order.isNewObject()
|
||||
& SecurityUtils.isUserInRole(UserRole.ROLE_CREATE_PROJECTS)) {
|
||||
& SecurityUtils
|
||||
.isSuperuserOrUserInRoles(UserRole.ROLE_CREATE_PROJECTS)) {
|
||||
return true;
|
||||
}
|
||||
try {
|
||||
|
|
@ -801,7 +802,8 @@ public class OrderModel extends IntegrationEntityModel implements IOrderModel {
|
|||
return true;
|
||||
}
|
||||
if (order.isNewObject()
|
||||
& SecurityUtils.isUserInRole(UserRole.ROLE_CREATE_PROJECTS)) {
|
||||
& SecurityUtils
|
||||
.isSuperuserOrUserInRoles(UserRole.ROLE_CREATE_PROJECTS)) {
|
||||
return true;
|
||||
}
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -45,7 +45,6 @@ import org.zkoss.ganttz.IPredicate;
|
|||
import org.zkoss.ganttz.Planner;
|
||||
import org.zkoss.ganttz.extensions.ICommandOnTask;
|
||||
import org.zkoss.ganttz.timetracker.zoom.ZoomLevel;
|
||||
import org.zkoss.web.servlet.dsp.action.Page;
|
||||
import org.zkoss.zk.ui.Component;
|
||||
import org.zkoss.zk.ui.Executions;
|
||||
import org.zkoss.zk.ui.WrongValueException;
|
||||
|
|
@ -149,7 +148,8 @@ public class CompanyPlanningController implements Composer {
|
|||
* the create buttons accordingly.
|
||||
*/
|
||||
private void checkCreationPermissions() {
|
||||
if (!SecurityUtils.isUserInRole(UserRole.ROLE_CREATE_PROJECTS)) {
|
||||
if (!SecurityUtils
|
||||
.isSuperuserOrUserInRoles(UserRole.ROLE_CREATE_PROJECTS)) {
|
||||
Button createOrderButton = (Button) planner.getPage().getFellow(
|
||||
"createOrderButton");
|
||||
if (createOrderButton != null) {
|
||||
|
|
|
|||
|
|
@ -407,7 +407,8 @@ public class MultipleTabsPlannerController implements Composer,
|
|||
}
|
||||
handler.registerBookmarkListener(this, comp.getPage());
|
||||
|
||||
if (SecurityUtils.isUserInRole(UserRole.ROLE_CREATE_PROJECTS)) {
|
||||
if (SecurityUtils
|
||||
.isSuperuserOrUserInRoles(UserRole.ROLE_CREATE_PROJECTS)) {
|
||||
org.zkoss.zk.ui.Component createOrderButton = comp.getPage()
|
||||
.getFellowIfAny(
|
||||
"createOrderButton");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue