WIP mifosx-126 - rename report and data table permissions and add upgrade script
This commit is contained in:
+1
-1
@@ -64,7 +64,7 @@ public class AdditionalFieldsServiceImpl implements AdditionalFieldsService {
|
||||
+ " left join m_permission p on p.id = rp.permission_id"
|
||||
+ " where ur.appuser_id = "
|
||||
+ context.authenticatedUser().getId()
|
||||
+ " and (p.code in ('ALL_FUNCTIONS', 'ALL_FUNCTIONS_READ') or p.code = concat('CAN_READ_', t.`name`, '_x', d.`name`))) "
|
||||
+ " and (p.code in ('ALL_FUNCTIONS', 'ALL_FUNCTIONS_READ') or p.code = concat('READ_', t.`name`, '_x', d.`name`))) "
|
||||
+ andClause + " order by d.`name`";
|
||||
|
||||
sql = genericDataService.wrapSQL(sql);
|
||||
|
||||
+1
-1
@@ -172,7 +172,7 @@ public class ReadReportingServiceImpl implements ReadReportingService {
|
||||
+ " left join m_permission p on p.id = rp.permission_id"
|
||||
+ " where ur.appuser_id = "
|
||||
+ context.authenticatedUser().getId()
|
||||
+ " and (p.code in ('ALL_FUNCTIONS', 'ALL_FUNCTIONS_READ') or p.code = concat('CAN_RUN_', r.report_name))) "
|
||||
+ " and (p.code in ('ALL_FUNCTIONS', 'ALL_FUNCTIONS_READ') or p.code = concat('READ_', r.report_name))) "
|
||||
+ " order by r.report_name, rp.parameter_id";
|
||||
} else {
|
||||
sql = getSQLtoRun(name, type, queryParams);
|
||||
|
||||
+2
-2
@@ -11,10 +11,10 @@ public interface ReadWriteNonCoreDataService {
|
||||
|
||||
List<DatatableData> retrieveDatatableNames(String appTable);
|
||||
|
||||
@PreAuthorize(value = "hasAnyRole('ALL_FUNCTIONS', 'CAN_REGISTER_DATATABLE')")
|
||||
@PreAuthorize(value = "hasAnyRole('ALL_FUNCTIONS', 'REGISTER_DATATABLE')")
|
||||
void registerDatatable(String datatable, String appTable);
|
||||
|
||||
@PreAuthorize(value = "hasAnyRole('ALL_FUNCTIONS', 'CAN_DEREGISTER_DATATABLE')")
|
||||
@PreAuthorize(value = "hasAnyRole('ALL_FUNCTIONS', 'DEREGISTER_DATATABLE')")
|
||||
void deregisterDatatable(String datatable);
|
||||
|
||||
GenericResultsetData retrieveDataTableGenericResultSet(String datatable,
|
||||
|
||||
+1
-1
@@ -68,7 +68,7 @@ public class ReadWriteNonCoreDataServiceImpl implements
|
||||
+ " left join m_permission p on p.id = rp.permission_id"
|
||||
+ " where ur.appuser_id = "
|
||||
+ context.authenticatedUser().getId()
|
||||
+ " and (p.code in ('ALL_FUNCTIONS', 'ALL_FUNCTIONS_READ') or p.code = concat('CAN_READ_', registered_table_name))) "
|
||||
+ " and (p.code in ('ALL_FUNCTIONS', 'ALL_FUNCTIONS_READ') or p.code = concat('READ_', registered_table_name))) "
|
||||
+ andClause
|
||||
+ " order by application_table_name, registered_table_name";
|
||||
|
||||
|
||||
@@ -263,7 +263,7 @@ public class AppUser extends AbstractAuditableCustom<AppUser, Long> implements
|
||||
public boolean hasNotPermissionForReport(String reportName) {
|
||||
|
||||
if (hasNotPermissionForAnyOf("ALL_FUNCTIONS", "ALL_FUNCTIONS_READ",
|
||||
"CAN_RUN_" + reportName))
|
||||
"READ_" + reportName))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
@@ -272,7 +272,7 @@ public class AppUser extends AbstractAuditableCustom<AppUser, Long> implements
|
||||
public boolean hasNotPermissionForDatatable(String datatable,
|
||||
String accessType) {
|
||||
|
||||
String matchPermission = "CAN_" + accessType + "_" + datatable;
|
||||
String matchPermission = accessType + "_" + datatable;
|
||||
|
||||
if (accessType.equalsIgnoreCase("READ")) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user