BF 2834795 CopyRole user on itself "deletes" all rights

Added check for same role, and updated parameters in AD to force selection of role.
This commit is contained in:
phib 2009-08-11 03:00:30 +00:00
parent 1ec97a82a9
commit 629243e61d
3 changed files with 94 additions and 0 deletions

View File

@ -21,6 +21,7 @@ package org.compiere.process;
import java.math.BigDecimal;
import org.adempiere.exceptions.AdempiereException;
import org.compiere.util.DB;
import org.compiere.util.Env;
@ -76,6 +77,9 @@ public class CopyRole extends SvrProcess
String[] keycolumns = new String[] {"AD_Window_ID", "AD_Process_ID", "AD_Form_ID",
"AD_Workflow_ID", "AD_Task_ID", "C_DocType_ID, AD_Ref_List_ID"};
if ( m_AD_Role_ID_From == m_AD_Role_ID_To )
throw new AdempiereException("Cannot copy role to itself");
int action = 0;
for ( int i = 0; i < tables.length; i++ )

View File

@ -0,0 +1,45 @@
-- 11/08/2009 12:43:24
-- Acct fact summary
UPDATE AD_Process SET Help='Copy role access records from one role to another. The existing access records for the destination role will be deleted.', Name='Copy Role',Updated=TO_DATE('2009-08-11 12:43:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=50010
;
-- 11/08/2009 12:43:24
-- Acct fact summary
UPDATE AD_Process_Trl SET IsTranslated='N' WHERE AD_Process_ID=50010
;
-- 11/08/2009 12:43:24
-- Acct fact summary
UPDATE AD_Menu SET Description='Copy Role', IsActive='Y', Name='Copy Role',Updated=TO_DATE('2009-08-11 12:43:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=50007
;
-- 11/08/2009 12:43:24
-- Acct fact summary
UPDATE AD_Menu_Trl SET IsTranslated='N' WHERE AD_Menu_ID=50007
;
-- 11/08/2009 12:44:32
-- Acct fact summary
UPDATE AD_Process_Para SET IsCentrallyMaintained='N', Name='Role From',Updated=TO_DATE('2009-08-11 12:44:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=50002
;
-- 11/08/2009 12:44:32
-- Acct fact summary
UPDATE AD_Process_Para_Trl SET IsTranslated='N' WHERE AD_Process_Para_ID=50002
;
-- 11/08/2009 12:44:46
-- Acct fact summary
UPDATE AD_Process_Para SET DefaultValue='-1', SeqNo = 15, IsCentrallyMaintained='N', Name='Role To',Updated=TO_DATE('2009-08-11 12:44:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=50001
;
-- 11/08/2009 12:44:46
-- Acct fact summary
UPDATE AD_Process_Para_Trl SET IsTranslated='N' WHERE AD_Process_Para_ID=50001
;
-- 11/08/2009 12:44:49
-- Acct fact summary
UPDATE AD_Process_Para SET DefaultValue='-1',Updated=TO_DATE('2009-08-11 12:44:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=50002
;

View File

@ -0,0 +1,45 @@
-- 11/08/2009 12:43:24
-- Acct fact summary
UPDATE AD_Process SET Help='Copy role access records from one role to another. The existing access records for the destination role will be deleted.', Name='Copy Role',Updated=TO_TIMESTAMP('2009-08-11 12:43:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=50010
;
-- 11/08/2009 12:43:24
-- Acct fact summary
UPDATE AD_Process_Trl SET IsTranslated='N' WHERE AD_Process_ID=50010
;
-- 11/08/2009 12:43:24
-- Acct fact summary
UPDATE AD_Menu SET Description='Copy Role', IsActive='Y', Name='Copy Role',Updated=TO_TIMESTAMP('2009-08-11 12:43:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=50007
;
-- 11/08/2009 12:43:24
-- Acct fact summary
UPDATE AD_Menu_Trl SET IsTranslated='N' WHERE AD_Menu_ID=50007
;
-- 11/08/2009 12:44:32
-- Acct fact summary
UPDATE AD_Process_Para SET IsCentrallyMaintained='N', Name='Role From',Updated=TO_TIMESTAMP('2009-08-11 12:44:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=50002
;
-- 11/08/2009 12:44:32
-- Acct fact summary
UPDATE AD_Process_Para_Trl SET IsTranslated='N' WHERE AD_Process_Para_ID=50002
;
-- 11/08/2009 12:44:46
-- Acct fact summary
UPDATE AD_Process_Para SET DefaultValue='-1', SeqNo = 15, IsCentrallyMaintained='N', Name='Role To',Updated=TO_TIMESTAMP('2009-08-11 12:44:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=50001
;
-- 11/08/2009 12:44:46
-- Acct fact summary
UPDATE AD_Process_Para_Trl SET IsTranslated='N' WHERE AD_Process_Para_ID=50001
;
-- 11/08/2009 12:44:49
-- Acct fact summary
UPDATE AD_Process_Para SET DefaultValue='-1',Updated=TO_TIMESTAMP('2009-08-11 12:44:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=50002
;