Here are the queries, you need to execute to insert Access Control Policies for Views and Controller Commands,
--Query for ACL to insert a View
INSERT INTO ACACTION (ACACTION_ID, ACTION) VALUES ((SELECT COUNTER FROM KEYS WHERE TABLENAME='acaction'), 'MyNewView');
INSERT INTO ACACTACTGP (ACACTGRP_ID,ACACTION_ID) VALUES
((SELECT ACACTGRP_ID FROM ACACTGRP WHERE GROUPNAME = 'AllSiteUsersViews'
AND MEMBER_ID IN (SELECT ORGENTITY_ID FROM ORGENTITY WHERE ORGENTITYNAME='Root Organization')
),(SELECT ACACTION_ID FROM ACACTION WHERE ACTION='MyNewView'));
UPDATE KEYS SET COUNTER = COUNTER+1 WHERE TABLENAME = 'acaction';
--Query for ACL to insert a Command
INSERT INTO ACRESCGRY
(ACRESCGRY_ID,RESCLASSNAME)
VALUES
((SELECT COUNTER FROM KEYS WHERE TABLENAME='acrescgry'),'com.ibm.commerce.sample.commands.MyNewControllerCmd');
INSERT INTO ACRESACT
(ACRESCGRY_ID, ACACTION_ID)
VALUES
((SELECT COUNTER FROM KEYS WHERE TABLENAME='acrescgry'),(SELECT ACACTION_ID FROM ACACTION WHERE ACTION='Execute'));
INSERT INTO ACRESGPRES
(ACRESGRP_ID, ACRESCGRY_ID)
VALUES
((SELECT ACRESGRP_ID FROM ACRESGRP WHERE MEMBER_ID IN
(SELECT ORGENTITY_ID FROM ORGENTITY WHERE ORGENTITYNAME='Root Organization') and GRPNAME='AllSiteUserCmdResourceGroup'),
(SELECT COUNTER FROM KEYS WHERE TABLENAME='acrescgry'));
UPDATE KEYS SET COUNTER = COUNTER+1 WHERE TABLENAME = 'acrescgry';
--Query for ACL to insert a View
INSERT INTO ACACTION (ACACTION_ID, ACTION) VALUES ((SELECT COUNTER FROM KEYS WHERE TABLENAME='acaction'), 'MyNewView');
INSERT INTO ACACTACTGP (ACACTGRP_ID,ACACTION_ID) VALUES
((SELECT ACACTGRP_ID FROM ACACTGRP WHERE GROUPNAME = 'AllSiteUsersViews'
AND MEMBER_ID IN (SELECT ORGENTITY_ID FROM ORGENTITY WHERE ORGENTITYNAME='Root Organization')
),(SELECT ACACTION_ID FROM ACACTION WHERE ACTION='MyNewView'));
UPDATE KEYS SET COUNTER = COUNTER+1 WHERE TABLENAME = 'acaction';
--Query for ACL to insert a Command
INSERT INTO ACRESCGRY
(ACRESCGRY_ID,RESCLASSNAME)
VALUES
((SELECT COUNTER FROM KEYS WHERE TABLENAME='acrescgry'),'com.ibm.commerce.sample.commands.MyNewControllerCmd');
INSERT INTO ACRESACT
(ACRESCGRY_ID, ACACTION_ID)
VALUES
((SELECT COUNTER FROM KEYS WHERE TABLENAME='acrescgry'),(SELECT ACACTION_ID FROM ACACTION WHERE ACTION='Execute'));
INSERT INTO ACRESGPRES
(ACRESGRP_ID, ACRESCGRY_ID)
VALUES
((SELECT ACRESGRP_ID FROM ACRESGRP WHERE MEMBER_ID IN
(SELECT ORGENTITY_ID FROM ORGENTITY WHERE ORGENTITYNAME='Root Organization') and GRPNAME='AllSiteUserCmdResourceGroup'),
(SELECT COUNTER FROM KEYS WHERE TABLENAME='acrescgry'));
UPDATE KEYS SET COUNTER = COUNTER+1 WHERE TABLENAME = 'acrescgry';
No comments:
Post a Comment