Skip to content

Commit

Permalink
Adding Sirtur needed authorizations
Browse files Browse the repository at this point in the history
  • Loading branch information
Redjaw authored Dec 1, 2023
1 parent 8e787f9 commit 75521a9
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ public class ManageRolesAction extends AbstractSpagoBIAction {
private final String BM_CATEGORY_ID = "bmCategoryId";
private final String BM_CATEGORIES = "bmCategories";

private final String SEE_HELP_ONLINE = "seeHelpOnline";
private final String ENABLE_DATA_PREPARATION = "enableDataPreparation";
private final String ENABLE_DOSSIER = "enableDossier";
private final String ENABLE_DASHBOARD_THEME_MANAGEMENT = "enableDashboardThemeManagement";

public static String START = "start";
public static String LIMIT = "limit";
public static Integer START_DEFAULT = 0;
Expand Down Expand Up @@ -211,6 +216,13 @@ public void doService() {
Boolean manageKpiValue = getAttributeAsBoolean(MANAGE_KPI_VALUE);
Boolean manageCalendar = getAttributeAsBoolean(MANAGE_CALENDAR);
Boolean functionsCatalogUsage = getAttributeAsBoolean(FUNCTIONS_CATALOG_USAGE);

Boolean seeHelpOnline = getAttributeAsBoolean(SEE_HELP_ONLINE);
Boolean enableDataPreparation = getAttributeAsBoolean(ENABLE_DATA_PREPARATION);
Boolean enableDossier = getAttributeAsBoolean(ENABLE_DOSSIER);
Boolean enableDashboardThemeManagement = getAttributeAsBoolean(ENABLE_DASHBOARD_THEME_MANAGEMENT);


List<String> bmCategoryIds = getAttributeAsList(BM_CATEGORIES);
if (bmCategoryIds.size() == 1) {
if (bmCategoryIds.get(0).equals("")) {
Expand Down Expand Up @@ -316,6 +328,12 @@ public void doService() {
role.setAbleToManageKpiValue(manageKpiValue);
role.setAbleToManageCalendar(manageCalendar);
role.setAbleToUseFunctionsCatalog(functionsCatalogUsage);

role.setAbleToSeeHelpOnline(seeHelpOnline);
role.setAbleToUseDataPreparation(enableDataPreparation);
role.setAbleToUseDossier(enableDossier);
role.setAbleToUseDashboardThemeManagement(enableDashboardThemeManagement);

try {
String id = getAttributeAsString(ID);
if (id != null && !id.equals("") && !id.equals("0")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,6 @@
<AUTHORIZATION productType="KnowageSI" authorizationName="ENABLE_DOSSIER" organization="DEFAULT_TENANT" />
<AUTHORIZATION productType="KnowageSI" authorizationName="ENABLE_DATA_PREPARATION" organization="DEFAULT_TENANT" />
<AUTHORIZATION productType="KnowageSI" authorizationName="ENABLE_DASHBOARD_THEME_MANAGEMENT" organization="DEFAULT_TENANT" />
<AUTHORIZATION productType="KnowageSI" authorizationName="SEE_HELP_ONLINE" organization="DEFAULT_TENANT" />
<AUTHORIZATION productType="KnowageSI" authorizationName="ENABLE_DOSSIER" organization="DEFAULT_TENANT" />
<AUTHORIZATION productType="KnowageSI" authorizationName="ENABLE_DATA_PREPARATION" organization="DEFAULT_TENANT" />
<AUTHORIZATION productType="KnowageSI" authorizationName="ENABLE_DASHBOARD_THEME_MANAGEMENT" organization="DEFAULT_TENANT" />


<!-- Authorizations for KnowageER -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,13 @@ private boolean isAbleTo(Role aRole, SbiAuthorizations authI) {
|| (authI.getName().equals("CREATE_SELF_SERVICE_GEOREPORT")
&& aRole.getAbleToCreateSelfServiceGeoreport())
|| (authI.getName().equals("EDIT_PYTHON_SCRIPTS") && aRole.getAbleToEditPythonScripts())
|| (authI.getName().equals("CREATE_CUSTOM_CHART") && aRole.getAbleToCreateCustomChart());
|| (authI.getName().equals("CREATE_CUSTOM_CHART") && aRole.getAbleToCreateCustomChart())
|| (authI.getName().equals("SEE_HELP_ONLINE") && aRole.getAbleToSeeHelpOnline())
|| (authI.getName().equals("ENABLE_DATA_PREPARATION") && aRole.getAbleToUseDataPreparation())
|| (authI.getName().equals("ENABLE_DOSSIER") && aRole.getAbleToUseDossier())
|| (authI.getName().equals("ENABLE_DASHBOARD_THEME_MANAGEMENT") && aRole.getAbleToUseDashboardThemeManagement());


}

/**
Expand Down Expand Up @@ -877,6 +883,19 @@ public Role toRole(SbiExtRoles hibRole) {
if (name.equals("CREATE_SELF_SERVICE_KPI")) {
role.setAbleToCreateSelfServiceKpi(true);
}
if(name.equals("SEE_HELP_ONLINE")) {
role.setAbleToSeeHelpOnline(true);
}
if(name.equals("ENABLE_DATA_PREPARATION")){
role.setAbleToUseDataPreparation(true);
}
if(name.equals("ENABLE_DOSSIER")){
role.setAbleToUseDossier(true);
}
if(name.equals("ENABLE_DASHBOARD_THEME_MANAGEMENT")){
role.setAbleToUseDashboardThemeManagement(true);
}


}

Expand Down
35 changes: 35 additions & 0 deletions knowageutils/src/main/java/it/eng/spagobi/commons/bo/Role.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ public class Role implements Serializable {
private boolean ableToCreateSelfServiceGeoreport;
private boolean ableToCreateSelfServiceKpi;

private boolean isAbleToSeeHelpOnline;
private boolean isAbleToUseDataPreparation;
private boolean isAbleToUseDossier;
private boolean isAbleToUseDashboardThemeManagement;

private boolean defaultRole;

private List<RoleMetaModelCategory> roleMetaModelCategories = new ArrayList<>();
Expand Down Expand Up @@ -788,4 +793,34 @@ public boolean getAbleToCreateSelfServiceKpi() {
public void setAbleToCreateSelfServiceKpi(boolean ableToCreateSelfServiceKpi) {
this.ableToCreateSelfServiceKpi = ableToCreateSelfServiceKpi;
}

public void setAbleToSeeHelpOnline(Boolean ableToSeeHelpOnline) {
this.isAbleToSeeHelpOnline = ableToSeeHelpOnline;
}
public Boolean getAbleToSeeHelpOnline() {
return isAbleToSeeHelpOnline;
}

public void setAbleToUseDataPreparation(Boolean ableToUseDataPreparation) {
this.isAbleToUseDataPreparation = ableToUseDataPreparation;
}
public Boolean getAbleToUseDataPreparation() {
return isAbleToUseDataPreparation;
}

public void setAbleToUseDossier(Boolean ableToUseDossier) {
this.isAbleToUseDossier = ableToUseDossier;
}
public Boolean getAbleToUseDossier() {
return isAbleToUseDossier;
}

public void setAbleToUseDashboardThemeManagement(Boolean ableToUseDashboardThemeManagement) {
this.isAbleToUseDashboardThemeManagement = ableToUseDashboardThemeManagement;
}
public Boolean getAbleToUseDashboardThemeManagement() {
return isAbleToUseDashboardThemeManagement;
}


}

0 comments on commit 75521a9

Please sign in to comment.