IDEMPIERE-5214 : Add AD_Role.IsClientAdministrator (#1220)

* IDEMPIERE-5214 : Add AD_Role.IsClientAdministrator

* IDEMPIERE-5214 : Add AD_Role.IsClientAdministrator - move scripts to i9

* IDEMPIERE-5214 : Add AD_Role.IsClientAdministrator - set value for new tenants

Co-Authored-By: Carlos Ruiz <carg67@gmail.com>
This commit is contained in:
Nicolas Micoud 2022-03-03 16:19:54 +01:00 committed by GitHub
parent 10d4399b0d
commit 7cabc12ebd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 224 additions and 5 deletions

View File

@ -0,0 +1,88 @@
-- IDEMPIERE-5214
SELECT register_migration_script('202203031417_IDEMPIERE-5214.sql') FROM dual;
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Mar 3, 2022, 2:17:27 PM CET
INSERT INTO AD_Element (AD_Element_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,ColumnName,Name,Description,PrintName,EntityType,AD_Element_UU) VALUES (203566,0,0,'Y',TO_TIMESTAMP('2022-03-03 14:17:27','YYYY-MM-DD HH24:MI:SS'),0,TO_TIMESTAMP('2022-03-03 14:17:27','YYYY-MM-DD HH24:MI:SS'),0,'IsClientAdministrator','Client Administrator','This role is a client administrator','Client Administrator','D','82757516-f616-41ee-bc22-7be819e4cafa')
;
-- Mar 3, 2022, 2:18:01 PM CET
INSERT INTO AD_Column (AD_Column_ID,Version,Name,Description,AD_Table_ID,ColumnName,DefaultValue,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,IsSelectionColumn,EntityType,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,SeqNoSelection,IsToolbarButton,IsSecure,FKConstraintType,IsHtml) VALUES (214711,0,'Client Administrator','This role is a client administrator',156,'IsClientAdministrator','N',1,'N','N','Y','N','N',0,'N',20,0,0,'Y',TO_TIMESTAMP('2022-03-03 14:18:01','YYYY-MM-DD HH24:MI:SS'),0,TO_TIMESTAMP('2022-03-03 14:18:01','YYYY-MM-DD HH24:MI:SS'),0,203566,'Y','N','D','N','N','N','Y','62f1e781-cdde-4a70-879e-a37fa30398ea','Y',0,'N','N','N','N')
;
-- Mar 3, 2022, 2:18:02 PM CET
ALTER TABLE AD_Role ADD IsClientAdministrator CHAR(1) DEFAULT 'N' CHECK (IsClientAdministrator IN ('Y','N')) NOT NULL
;
-- Mar 3, 2022, 2:18:15 PM CET
INSERT INTO AD_Field (AD_Field_ID,Name,Description,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan) VALUES (206904,'Client Administrator','This role is a client administrator',119,214711,'Y',1,450,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2022-03-03 14:18:15','YYYY-MM-DD HH24:MI:SS'),0,TO_TIMESTAMP('2022-03-03 14:18:15','YYYY-MM-DD HH24:MI:SS'),0,'N','Y','D','00ef90d5-1086-4c52-b0bd-a632731b8b4a','Y',450,2,2)
;
-- Mar 3, 2022, 2:18:33 PM CET
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=260, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, XPosition=4, ColumnSpan=1, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-03-03 14:18:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=206904
;
-- Mar 3, 2022, 2:18:33 PM CET
UPDATE AD_Field SET SeqNo=270, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-03-03 14:18:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=8311
;
-- Mar 3, 2022, 2:18:33 PM CET
UPDATE AD_Field SET SeqNo=280, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-03-03 14:18:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=11006
;
-- Mar 3, 2022, 2:18:33 PM CET
UPDATE AD_Field SET SeqNo=290, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-03-03 14:18:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=12367
;
-- Mar 3, 2022, 2:18:33 PM CET
UPDATE AD_Field SET SeqNo=300, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-03-03 14:18:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=12368
;
-- Mar 3, 2022, 2:18:33 PM CET
UPDATE AD_Field SET SeqNo=310, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-03-03 14:18:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=11256
;
-- Mar 3, 2022, 2:18:33 PM CET
UPDATE AD_Field SET SeqNo=320, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-03-03 14:18:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=50168
;
-- Mar 3, 2022, 2:18:33 PM CET
UPDATE AD_Field SET SeqNo=330, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-03-03 14:18:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=50178
;
-- Mar 3, 2022, 2:18:33 PM CET
UPDATE AD_Field SET SeqNo=340, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-03-03 14:18:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=50176
;
-- Mar 3, 2022, 2:18:33 PM CET
UPDATE AD_Field SET SeqNo=350, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-03-03 14:18:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=50170
;
-- Mar 3, 2022, 2:18:33 PM CET
UPDATE AD_Field SET SeqNo=360, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-03-03 14:18:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=50174
;
-- Mar 3, 2022, 2:18:33 PM CET
UPDATE AD_Field SET SeqNo=370, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-03-03 14:18:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=50173
;
-- Mar 3, 2022, 2:18:33 PM CET
UPDATE AD_Field SET SeqNo=380, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-03-03 14:18:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=50172
;
-- Mar 3, 2022, 2:18:33 PM CET
UPDATE AD_Field SET SeqNo=390, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-03-03 14:18:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=50175
;
-- Mar 3, 2022, 2:18:33 PM CET
UPDATE AD_Field SET SeqNo=400, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-03-03 14:18:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=50169
;
-- Mar 3, 2022, 2:18:33 PM CET
UPDATE AD_Field SET SeqNo=410, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-03-03 14:18:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=50177
;
-- Set GardenWorld Admin and GardenWorld Admin Not Advanced roles as Client Administrator
UPDATE AD_Role SET IsClientAdministrator = 'Y' WHERE AD_Role_ID IN (102, 200001);

View File

@ -0,0 +1,85 @@
-- IDEMPIERE-5214
SELECT register_migration_script('202203031417_IDEMPIERE-5214.sql') FROM dual;
-- Mar 3, 2022, 2:17:27 PM CET
INSERT INTO AD_Element (AD_Element_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,ColumnName,Name,Description,PrintName,EntityType,AD_Element_UU) VALUES (203566,0,0,'Y',TO_TIMESTAMP('2022-03-03 14:17:27','YYYY-MM-DD HH24:MI:SS'),0,TO_TIMESTAMP('2022-03-03 14:17:27','YYYY-MM-DD HH24:MI:SS'),0,'IsClientAdministrator','Client Administrator','This role is a client administrator','Client Administrator','D','82757516-f616-41ee-bc22-7be819e4cafa')
;
-- Mar 3, 2022, 2:18:01 PM CET
INSERT INTO AD_Column (AD_Column_ID,Version,Name,Description,AD_Table_ID,ColumnName,DefaultValue,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,IsSelectionColumn,EntityType,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,SeqNoSelection,IsToolbarButton,IsSecure,FKConstraintType,IsHtml) VALUES (214711,0,'Client Administrator','This role is a client administrator',156,'IsClientAdministrator','N',1,'N','N','Y','N','N',0,'N',20,0,0,'Y',TO_TIMESTAMP('2022-03-03 14:18:01','YYYY-MM-DD HH24:MI:SS'),0,TO_TIMESTAMP('2022-03-03 14:18:01','YYYY-MM-DD HH24:MI:SS'),0,203566,'Y','N','D','N','N','N','Y','62f1e781-cdde-4a70-879e-a37fa30398ea','Y',0,'N','N','N','N')
;
-- Mar 3, 2022, 2:18:02 PM CET
ALTER TABLE AD_Role ADD COLUMN IsClientAdministrator CHAR(1) DEFAULT 'N' CHECK (IsClientAdministrator IN ('Y','N')) NOT NULL
;
-- Mar 3, 2022, 2:18:15 PM CET
INSERT INTO AD_Field (AD_Field_ID,Name,Description,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan) VALUES (206904,'Client Administrator','This role is a client administrator',119,214711,'Y',1,450,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2022-03-03 14:18:15','YYYY-MM-DD HH24:MI:SS'),0,TO_TIMESTAMP('2022-03-03 14:18:15','YYYY-MM-DD HH24:MI:SS'),0,'N','Y','D','00ef90d5-1086-4c52-b0bd-a632731b8b4a','Y',450,2,2)
;
-- Mar 3, 2022, 2:18:33 PM CET
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=260, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, XPosition=4, ColumnSpan=1, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-03-03 14:18:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=206904
;
-- Mar 3, 2022, 2:18:33 PM CET
UPDATE AD_Field SET SeqNo=270, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-03-03 14:18:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=8311
;
-- Mar 3, 2022, 2:18:33 PM CET
UPDATE AD_Field SET SeqNo=280, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-03-03 14:18:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=11006
;
-- Mar 3, 2022, 2:18:33 PM CET
UPDATE AD_Field SET SeqNo=290, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-03-03 14:18:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=12367
;
-- Mar 3, 2022, 2:18:33 PM CET
UPDATE AD_Field SET SeqNo=300, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-03-03 14:18:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=12368
;
-- Mar 3, 2022, 2:18:33 PM CET
UPDATE AD_Field SET SeqNo=310, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-03-03 14:18:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=11256
;
-- Mar 3, 2022, 2:18:33 PM CET
UPDATE AD_Field SET SeqNo=320, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-03-03 14:18:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=50168
;
-- Mar 3, 2022, 2:18:33 PM CET
UPDATE AD_Field SET SeqNo=330, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-03-03 14:18:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=50178
;
-- Mar 3, 2022, 2:18:33 PM CET
UPDATE AD_Field SET SeqNo=340, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-03-03 14:18:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=50176
;
-- Mar 3, 2022, 2:18:33 PM CET
UPDATE AD_Field SET SeqNo=350, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-03-03 14:18:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=50170
;
-- Mar 3, 2022, 2:18:33 PM CET
UPDATE AD_Field SET SeqNo=360, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-03-03 14:18:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=50174
;
-- Mar 3, 2022, 2:18:33 PM CET
UPDATE AD_Field SET SeqNo=370, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-03-03 14:18:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=50173
;
-- Mar 3, 2022, 2:18:33 PM CET
UPDATE AD_Field SET SeqNo=380, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-03-03 14:18:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=50172
;
-- Mar 3, 2022, 2:18:33 PM CET
UPDATE AD_Field SET SeqNo=390, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-03-03 14:18:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=50175
;
-- Mar 3, 2022, 2:18:33 PM CET
UPDATE AD_Field SET SeqNo=400, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-03-03 14:18:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=50169
;
-- Mar 3, 2022, 2:18:33 PM CET
UPDATE AD_Field SET SeqNo=410, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-03-03 14:18:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=50177
;
-- Set GardenWorld Admin and GardenWorld Admin Not Advanced roles as Client Administrator
UPDATE AD_Role SET IsClientAdministrator = 'Y' WHERE AD_Role_ID IN (102, 200001);

View File

@ -22,7 +22,7 @@ import org.compiere.util.KeyNamePair;
/** Generated Interface for AD_Role /** Generated Interface for AD_Role
* @author iDempiere (generated) * @author iDempiere (generated)
* @version Release 9 * @version Release 10
*/ */
public interface I_AD_Role public interface I_AD_Role
{ {
@ -387,6 +387,19 @@ public interface I_AD_Role
*/ */
public boolean isChangeLog(); public boolean isChangeLog();
/** Column name IsClientAdministrator */
public static final String COLUMNNAME_IsClientAdministrator = "IsClientAdministrator";
/** Set Client Administrator.
* This role is a client administrator
*/
public void setIsClientAdministrator (boolean IsClientAdministrator);
/** Get Client Administrator.
* This role is a client administrator
*/
public boolean isClientAdministrator();
/** Column name IsDiscountAllowedOnTotal */ /** Column name IsDiscountAllowedOnTotal */
public static final String COLUMNNAME_IsDiscountAllowedOnTotal = "IsDiscountAllowedOnTotal"; public static final String COLUMNNAME_IsDiscountAllowedOnTotal = "IsDiscountAllowedOnTotal";

View File

@ -244,6 +244,7 @@ public final class MSetup
admin.setPreferenceType(MRole.PREFERENCETYPE_Client); admin.setPreferenceType(MRole.PREFERENCETYPE_Client);
admin.setIsShowAcct(true); admin.setIsShowAcct(true);
admin.setIsAccessAdvanced(true); admin.setIsAccessAdvanced(true);
admin.setIsClientAdministrator(true);
if (!admin.save()) if (!admin.save())
{ {
String err = "Admin Role A NOT inserted"; String err = "Admin Role A NOT inserted";
@ -271,6 +272,7 @@ public final class MSetup
user.setClientOrg(m_client); user.setClientOrg(m_client);
user.setName(name); user.setName(name);
user.setIsAccessAdvanced(false); user.setIsAccessAdvanced(false);
user.setIsClientAdministrator(false);
if (!user.save()) if (!user.save())
{ {
String err = "User Role A NOT inserted"; String err = "User Role A NOT inserted";

View File

@ -25,7 +25,7 @@ import org.compiere.util.KeyNamePair;
/** Generated Model for AD_Role /** Generated Model for AD_Role
* @author iDempiere (generated) * @author iDempiere (generated)
* @version Release 9 - $Id$ */ * @version Release 10 - $Id$ */
@org.adempiere.base.Model(table="AD_Role") @org.adempiere.base.Model(table="AD_Role")
public class X_AD_Role extends PO implements I_AD_Role, I_Persistent public class X_AD_Role extends PO implements I_AD_Role, I_Persistent
{ {
@ -33,7 +33,7 @@ public class X_AD_Role extends PO implements I_AD_Role, I_Persistent
/** /**
* *
*/ */
private static final long serialVersionUID = 20220116L; private static final long serialVersionUID = 20220303L;
/** Standard Constructor */ /** Standard Constructor */
public X_AD_Role (Properties ctx, int AD_Role_ID, String trxName) public X_AD_Role (Properties ctx, int AD_Role_ID, String trxName)
@ -72,6 +72,8 @@ public class X_AD_Role extends PO implements I_AD_Role, I_Persistent
setIsCanReport (true); setIsCanReport (true);
// Y // Y
setIsChangeLog (false); setIsChangeLog (false);
// N
setIsClientAdministrator (false);
// N // N
setIsDiscountAllowedOnTotal (false); setIsDiscountAllowedOnTotal (false);
setIsDiscountUptoLimitPrice (false); setIsDiscountUptoLimitPrice (false);
@ -137,6 +139,8 @@ public class X_AD_Role extends PO implements I_AD_Role, I_Persistent
setIsCanReport (true); setIsCanReport (true);
// Y // Y
setIsChangeLog (false); setIsChangeLog (false);
// N
setIsClientAdministrator (false);
// N // N
setIsDiscountAllowedOnTotal (false); setIsDiscountAllowedOnTotal (false);
setIsDiscountUptoLimitPrice (false); setIsDiscountUptoLimitPrice (false);
@ -763,6 +767,29 @@ public class X_AD_Role extends PO implements I_AD_Role, I_Persistent
return false; return false;
} }
/** Set Client Administrator.
@param IsClientAdministrator This role is a client administrator
*/
public void setIsClientAdministrator (boolean IsClientAdministrator)
{
set_Value (COLUMNNAME_IsClientAdministrator, Boolean.valueOf(IsClientAdministrator));
}
/** Get Client Administrator.
@return This role is a client administrator
*/
public boolean isClientAdministrator()
{
Object oo = get_Value(COLUMNNAME_IsClientAdministrator);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set IsDiscountAllowedOnTotal. /** Set IsDiscountAllowedOnTotal.
@param IsDiscountAllowedOnTotal IsDiscountAllowedOnTotal @param IsDiscountAllowedOnTotal IsDiscountAllowedOnTotal
*/ */

View File

@ -106,6 +106,7 @@ public final class Env
public static final String DB_TYPE = "#DBType"; public static final String DB_TYPE = "#DBType";
public static final String GL_CATEGORY_ID = "#GL_Category_ID"; public static final String GL_CATEGORY_ID = "#GL_Category_ID";
public static final String HAS_ALIAS = "$HasAlias"; public static final String HAS_ALIAS = "$HasAlias";
public static final String IS_CLIENT_ADMIN = "#IsClientAdmin";
/** Context Language identifier */ /** Context Language identifier */
public static final String LANGUAGE = "#AD_Language"; public static final String LANGUAGE = "#AD_Language";
public static final String LANGUAGE_NAME = "#LanguageName"; public static final String LANGUAGE_NAME = "#LanguageName";

View File

@ -469,7 +469,7 @@ public class Login
ArrayList<KeyNamePair> list = new ArrayList<KeyNamePair>(); ArrayList<KeyNamePair> list = new ArrayList<KeyNamePair>();
KeyNamePair[] retValue = null; KeyNamePair[] retValue = null;
String sql = "SELECT DISTINCT r.UserLevel, r.ConnectionProfile, " // 1/2 String sql = "SELECT DISTINCT r.UserLevel, r.ConnectionProfile, " // 1/2
+ " c.AD_Client_ID,c.Name,r.RoleType " // 3/4/5 + " c.AD_Client_ID,c.Name,r.RoleType,r.IsClientAdministrator " // 3/4/5/6
+ "FROM AD_Role r" + "FROM AD_Role r"
+ " INNER JOIN AD_Client c ON (r.AD_Client_ID=c.AD_Client_ID) " + " INNER JOIN AD_Client c ON (r.AD_Client_ID=c.AD_Client_ID) "
+ "WHERE r.AD_Role_ID=?" // #1 + "WHERE r.AD_Role_ID=?" // #1
@ -494,6 +494,7 @@ public class Login
Env.setContext(m_ctx, Env.AD_ROLE_ID, role.getKey()); Env.setContext(m_ctx, Env.AD_ROLE_ID, role.getKey());
Env.setContext(m_ctx, Env.AD_ROLE_NAME, role.getName()); Env.setContext(m_ctx, Env.AD_ROLE_NAME, role.getName());
Env.setContext(m_ctx, Env.AD_ROLE_TYPE, rs.getString("RoleType")); Env.setContext(m_ctx, Env.AD_ROLE_TYPE, rs.getString("RoleType"));
Env.setContext(m_ctx, Env.IS_CLIENT_ADMIN, rs.getString("IsClientAdministrator"));
Ini.setProperty(Ini.P_ROLE, role.getName()); Ini.setProperty(Ini.P_ROLE, role.getName());
// User Level // User Level
Env.setContext(m_ctx, Env.USER_LEVEL, rs.getString(1)); // Format 'SCO' Env.setContext(m_ctx, Env.USER_LEVEL, rs.getString(1)); // Format 'SCO'
@ -547,7 +548,7 @@ public class Login
ArrayList<KeyNamePair> list = new ArrayList<KeyNamePair>(); ArrayList<KeyNamePair> list = new ArrayList<KeyNamePair>();
KeyNamePair[] retValue = null; KeyNamePair[] retValue = null;
// //
String sql = " SELECT DISTINCT r.UserLevel, r.ConnectionProfile,o.AD_Org_ID,o.Name,o.IsSummary,r.RoleType " String sql = " SELECT DISTINCT r.UserLevel, r.ConnectionProfile,o.AD_Org_ID,o.Name,o.IsSummary,r.RoleType,r.IsClientAdministrator "
+" FROM AD_Org o" +" FROM AD_Org o"
+" INNER JOIN AD_Role r on (r.AD_Role_ID=?)" +" INNER JOIN AD_Role r on (r.AD_Role_ID=?)"
+" INNER JOIN AD_Client c on (c.AD_Client_ID=?)" +" INNER JOIN AD_Client c on (c.AD_Client_ID=?)"
@ -581,6 +582,7 @@ public class Login
Env.setContext(m_ctx, Env.AD_ROLE_ID, rol.getKey()); Env.setContext(m_ctx, Env.AD_ROLE_ID, rol.getKey());
Env.setContext(m_ctx, Env.AD_ROLE_NAME, rol.getName()); Env.setContext(m_ctx, Env.AD_ROLE_NAME, rol.getName());
Env.setContext(m_ctx, Env.AD_ROLE_TYPE, rs.getString("RoleType")); Env.setContext(m_ctx, Env.AD_ROLE_TYPE, rs.getString("RoleType"));
Env.setContext(m_ctx, Env.IS_CLIENT_ADMIN, rs.getString("IsClientAdministrator"));
Ini.setProperty(Ini.P_ROLE, rol.getName()); Ini.setProperty(Ini.P_ROLE, rol.getName());
// User Level // User Level
Env.setContext(m_ctx, Env.USER_LEVEL, rs.getString(1)); // Format 'SCO' Env.setContext(m_ctx, Env.USER_LEVEL, rs.getString(1)); // Format 'SCO'

View File

@ -591,6 +591,7 @@ public class AdempiereWebUI extends Window implements EventListener<Event>, IWeb
Env.setContext(properties, Env.AD_ROLE_ID, Env.getAD_Role_ID(Env.getCtx())); Env.setContext(properties, Env.AD_ROLE_ID, Env.getAD_Role_ID(Env.getCtx()));
Env.setContext(properties, Env.AD_ROLE_NAME, Env.getContext(Env.getCtx(), Env.AD_ROLE_NAME)); Env.setContext(properties, Env.AD_ROLE_NAME, Env.getContext(Env.getCtx(), Env.AD_ROLE_NAME));
Env.setContext(properties, Env.AD_ROLE_TYPE, Env.getContext(Env.getCtx(), Env.AD_ROLE_TYPE)); Env.setContext(properties, Env.AD_ROLE_TYPE, Env.getContext(Env.getCtx(), Env.AD_ROLE_TYPE));
Env.setContext(properties, Env.IS_CLIENT_ADMIN, Env.getContext(Env.getCtx(), Env.IS_CLIENT_ADMIN));
Env.setContext(properties, Env.USER_LEVEL, Env.getContext(Env.getCtx(), Env.USER_LEVEL)); Env.setContext(properties, Env.USER_LEVEL, Env.getContext(Env.getCtx(), Env.USER_LEVEL));
Env.setContext(properties, Env.AD_ORG_NAME, Env.getContext(Env.getCtx(), Env.AD_ORG_NAME)); Env.setContext(properties, Env.AD_ORG_NAME, Env.getContext(Env.getCtx(), Env.AD_ORG_NAME));
Env.setContext(properties, Env.M_WAREHOUSE_ID, Env.getContext(Env.getCtx(), Env.M_WAREHOUSE_ID)); Env.setContext(properties, Env.M_WAREHOUSE_ID, Env.getContext(Env.getCtx(), Env.M_WAREHOUSE_ID));