@@ -35,103 +35,103 @@ |
||
35 | 35 | * "Powered by SugarCRM". |
36 | 36 | ********************************************************************************/ |
37 | 37 | |
38 | - if(!defined('ACL_ALLOW_NONE')){ |
|
39 | - define('ACL_ALLOW_ADMIN_DEV', 100); |
|
40 | - define('ACL_ALLOW_ADMIN', 99); |
|
41 | - define('ACL_ALLOW_ALL', 90); |
|
42 | - define('ACL_ALLOW_ENABLED', 89); |
|
43 | - /* BEGIN - SECURITY GROUPS */ |
|
44 | - define('ACL_ALLOW_GROUP', 80); //securitygroup |
|
45 | - /* END - SECURITY GROUPS */ |
|
46 | - define('ACL_ALLOW_OWNER', 75); |
|
47 | - define('ACL_ALLOW_NORMAL', 1); |
|
48 | - define('ACL_ALLOW_DEFAULT', 0); |
|
49 | - define('ACL_ALLOW_DISABLED', -98); |
|
50 | - define('ACL_ALLOW_NONE', -99); |
|
51 | - define('ACL_ALLOW_DEV', 95); |
|
52 | - } |
|
53 | - /** |
|
54 | - * $GLOBALS['ACLActionAccessLevels |
|
55 | - * these are rendering descriptions for Access Levels giving information such as the label, color, and text color to use when rendering the access level |
|
56 | - */ |
|
57 | - $GLOBALS['ACLActionAccessLevels'] = array( |
|
58 | - ACL_ALLOW_ALL=>array('color'=>'#008000', 'label'=>'LBL_ACCESS_ALL', 'text_color'=>'white'), |
|
59 | - ACL_ALLOW_OWNER=>array('color'=>'#6F6800', 'label'=>'LBL_ACCESS_OWNER', 'text_color'=>'white'), |
|
60 | - ACL_ALLOW_NONE=>array('color'=>'#FF0000', 'label'=>'LBL_ACCESS_NONE', 'text_color'=>'white'), |
|
61 | - ACL_ALLOW_ENABLED=>array('color'=>'#008000', 'label'=>'LBL_ACCESS_ENABLED', 'text_color'=>'white'), |
|
62 | - ACL_ALLOW_DISABLED=>array('color'=>'#FF0000', 'label'=>'LBL_ACCESS_DISABLED', 'text_color'=>'white'), |
|
63 | - ACL_ALLOW_ADMIN=>array('color'=>'#0000FF', 'label'=>'LBL_ACCESS_ADMIN', 'text_color'=>'white'), |
|
64 | - ACL_ALLOW_NORMAL=>array('color'=>'#008000', 'label'=>'LBL_ACCESS_NORMAL', 'text_color'=>'white'), |
|
65 | - ACL_ALLOW_DEFAULT=>array('color'=>'#008000', 'label'=>'LBL_ACCESS_DEFAULT', 'text_color'=>'white'), |
|
66 | - ACL_ALLOW_DEV=>array('color'=>'#0000FF', 'label'=>'LBL_ACCESS_DEV', 'text_color'=>'white'), |
|
67 | - ACL_ALLOW_ADMIN_DEV=>array('color'=>'#0000FF', 'label'=>'LBL_ACCESS_ADMIN_DEV', 'text_color'=>'white'), |
|
68 | - /* BEGIN - SECURITY GROUPS */ |
|
69 | - ACL_ALLOW_GROUP=>array('color'=>'#0000A0', 'label'=>'LBL_ACCESS_GROUP', 'text_color'=>'white'), //securitygroup |
|
70 | - /* END - SECURITY GROUPS */ |
|
71 | - ); |
|
38 | + if(!defined('ACL_ALLOW_NONE')){ |
|
39 | + define('ACL_ALLOW_ADMIN_DEV', 100); |
|
40 | + define('ACL_ALLOW_ADMIN', 99); |
|
41 | + define('ACL_ALLOW_ALL', 90); |
|
42 | + define('ACL_ALLOW_ENABLED', 89); |
|
43 | + /* BEGIN - SECURITY GROUPS */ |
|
44 | + define('ACL_ALLOW_GROUP', 80); //securitygroup |
|
45 | + /* END - SECURITY GROUPS */ |
|
46 | + define('ACL_ALLOW_OWNER', 75); |
|
47 | + define('ACL_ALLOW_NORMAL', 1); |
|
48 | + define('ACL_ALLOW_DEFAULT', 0); |
|
49 | + define('ACL_ALLOW_DISABLED', -98); |
|
50 | + define('ACL_ALLOW_NONE', -99); |
|
51 | + define('ACL_ALLOW_DEV', 95); |
|
52 | + } |
|
53 | + /** |
|
54 | + * $GLOBALS['ACLActionAccessLevels |
|
55 | + * these are rendering descriptions for Access Levels giving information such as the label, color, and text color to use when rendering the access level |
|
56 | + */ |
|
57 | + $GLOBALS['ACLActionAccessLevels'] = array( |
|
58 | + ACL_ALLOW_ALL=>array('color'=>'#008000', 'label'=>'LBL_ACCESS_ALL', 'text_color'=>'white'), |
|
59 | + ACL_ALLOW_OWNER=>array('color'=>'#6F6800', 'label'=>'LBL_ACCESS_OWNER', 'text_color'=>'white'), |
|
60 | + ACL_ALLOW_NONE=>array('color'=>'#FF0000', 'label'=>'LBL_ACCESS_NONE', 'text_color'=>'white'), |
|
61 | + ACL_ALLOW_ENABLED=>array('color'=>'#008000', 'label'=>'LBL_ACCESS_ENABLED', 'text_color'=>'white'), |
|
62 | + ACL_ALLOW_DISABLED=>array('color'=>'#FF0000', 'label'=>'LBL_ACCESS_DISABLED', 'text_color'=>'white'), |
|
63 | + ACL_ALLOW_ADMIN=>array('color'=>'#0000FF', 'label'=>'LBL_ACCESS_ADMIN', 'text_color'=>'white'), |
|
64 | + ACL_ALLOW_NORMAL=>array('color'=>'#008000', 'label'=>'LBL_ACCESS_NORMAL', 'text_color'=>'white'), |
|
65 | + ACL_ALLOW_DEFAULT=>array('color'=>'#008000', 'label'=>'LBL_ACCESS_DEFAULT', 'text_color'=>'white'), |
|
66 | + ACL_ALLOW_DEV=>array('color'=>'#0000FF', 'label'=>'LBL_ACCESS_DEV', 'text_color'=>'white'), |
|
67 | + ACL_ALLOW_ADMIN_DEV=>array('color'=>'#0000FF', 'label'=>'LBL_ACCESS_ADMIN_DEV', 'text_color'=>'white'), |
|
68 | + /* BEGIN - SECURITY GROUPS */ |
|
69 | + ACL_ALLOW_GROUP=>array('color'=>'#0000A0', 'label'=>'LBL_ACCESS_GROUP', 'text_color'=>'white'), //securitygroup |
|
70 | + /* END - SECURITY GROUPS */ |
|
71 | + ); |
|
72 | 72 | /** |
73 | - * $GLOBALS['ACLActions |
|
74 | - * These are the actions for a given type. It includes the ACCESS Levels for that action and the label for that action. Every an object of the category (e.g. module) is added all associated actions are added for that object |
|
75 | - */ |
|
73 | + * $GLOBALS['ACLActions |
|
74 | + * These are the actions for a given type. It includes the ACCESS Levels for that action and the label for that action. Every an object of the category (e.g. module) is added all associated actions are added for that object |
|
75 | + */ |
|
76 | 76 | /* BEGIN - SECURITY GROUPS */ |
77 | 77 | $GLOBALS['ACLActions'] = array( |
78 | - 'module'=>array('actions'=> |
|
79 | - array( |
|
80 | - 'access'=> |
|
81 | - array( |
|
82 | - 'aclaccess'=>array(ACL_ALLOW_ENABLED,ACL_ALLOW_DEFAULT, ACL_ALLOW_DISABLED), |
|
83 | - 'label'=>'LBL_ACTION_ACCESS', |
|
84 | - 'default'=>ACL_ALLOW_ENABLED, |
|
85 | - ), |
|
78 | + 'module'=>array('actions'=> |
|
79 | + array( |
|
80 | + 'access'=> |
|
81 | + array( |
|
82 | + 'aclaccess'=>array(ACL_ALLOW_ENABLED,ACL_ALLOW_DEFAULT, ACL_ALLOW_DISABLED), |
|
83 | + 'label'=>'LBL_ACTION_ACCESS', |
|
84 | + 'default'=>ACL_ALLOW_ENABLED, |
|
85 | + ), |
|
86 | 86 | |
87 | - 'view'=> |
|
88 | - array( |
|
89 | - 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_GROUP,ACL_ALLOW_OWNER,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
90 | - 'label'=>'LBL_ACTION_VIEW', |
|
91 | - 'default'=>ACL_ALLOW_ALL, |
|
92 | - ), |
|
87 | + 'view'=> |
|
88 | + array( |
|
89 | + 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_GROUP,ACL_ALLOW_OWNER,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
90 | + 'label'=>'LBL_ACTION_VIEW', |
|
91 | + 'default'=>ACL_ALLOW_ALL, |
|
92 | + ), |
|
93 | 93 | |
94 | - 'list'=> |
|
95 | - array( |
|
96 | - 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_GROUP,ACL_ALLOW_OWNER,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
97 | - 'label'=>'LBL_ACTION_LIST', |
|
98 | - 'default'=>ACL_ALLOW_ALL, |
|
99 | - ), |
|
100 | - 'edit'=> |
|
101 | - array( |
|
102 | - 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_GROUP,ACL_ALLOW_OWNER,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
103 | - 'label'=>'LBL_ACTION_EDIT', |
|
104 | - 'default'=>ACL_ALLOW_ALL, |
|
94 | + 'list'=> |
|
95 | + array( |
|
96 | + 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_GROUP,ACL_ALLOW_OWNER,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
97 | + 'label'=>'LBL_ACTION_LIST', |
|
98 | + 'default'=>ACL_ALLOW_ALL, |
|
99 | + ), |
|
100 | + 'edit'=> |
|
101 | + array( |
|
102 | + 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_GROUP,ACL_ALLOW_OWNER,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
103 | + 'label'=>'LBL_ACTION_EDIT', |
|
104 | + 'default'=>ACL_ALLOW_ALL, |
|
105 | 105 | |
106 | - ), |
|
107 | - 'delete'=> |
|
108 | - array( |
|
109 | - 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_GROUP,ACL_ALLOW_OWNER,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
110 | - 'label'=>'LBL_ACTION_DELETE', |
|
111 | - 'default'=>ACL_ALLOW_ALL, |
|
106 | + ), |
|
107 | + 'delete'=> |
|
108 | + array( |
|
109 | + 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_GROUP,ACL_ALLOW_OWNER,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
110 | + 'label'=>'LBL_ACTION_DELETE', |
|
111 | + 'default'=>ACL_ALLOW_ALL, |
|
112 | 112 | |
113 | - ), |
|
114 | - 'import'=> |
|
115 | - array( |
|
116 | - 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
117 | - 'label'=>'LBL_ACTION_IMPORT', |
|
118 | - 'default'=>ACL_ALLOW_ALL, |
|
119 | - ), |
|
120 | - 'export'=> |
|
121 | - array( |
|
122 | - 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_GROUP,ACL_ALLOW_OWNER,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
123 | - 'label'=>'LBL_ACTION_EXPORT', |
|
124 | - 'default'=>ACL_ALLOW_ALL, |
|
125 | - ), |
|
113 | + ), |
|
114 | + 'import'=> |
|
115 | + array( |
|
116 | + 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
117 | + 'label'=>'LBL_ACTION_IMPORT', |
|
118 | + 'default'=>ACL_ALLOW_ALL, |
|
119 | + ), |
|
120 | + 'export'=> |
|
121 | + array( |
|
122 | + 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_GROUP,ACL_ALLOW_OWNER,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
123 | + 'label'=>'LBL_ACTION_EXPORT', |
|
124 | + 'default'=>ACL_ALLOW_ALL, |
|
125 | + ), |
|
126 | 126 | 'massupdate'=> |
127 | - array( |
|
128 | - 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
129 | - 'label'=>'LBL_ACTION_MASSUPDATE', |
|
130 | - 'default'=>ACL_ALLOW_ALL, |
|
131 | - ), |
|
127 | + array( |
|
128 | + 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
129 | + 'label'=>'LBL_ACTION_MASSUPDATE', |
|
130 | + 'default'=>ACL_ALLOW_ALL, |
|
131 | + ), |
|
132 | 132 | |
133 | 133 | |
134 | - ),), |
|
134 | + ),), |
|
135 | 135 | ); |
136 | 136 | /* END - SECURITY GROUPS */ |
137 | 137 |
@@ -42,34 +42,34 @@ discard block |
||
42 | 42 | |
43 | 43 | |
44 | 44 | $dictionary['ACLAction'] = array('table' => 'acl_actions', 'comment' => 'Determine the allowable actions available to users' |
45 | - ,'fields' => array ( |
|
46 | - 'id' => |
|
47 | - array ( |
|
45 | + ,'fields' => array ( |
|
46 | + 'id' => |
|
47 | + array ( |
|
48 | 48 | 'name' => 'id', |
49 | 49 | 'vname' => 'LBL_ID', |
50 | 50 | 'required'=>true, |
51 | 51 | 'type' => 'id', |
52 | 52 | 'reportable'=>false, |
53 | 53 | 'comment' => 'Unique identifier' |
54 | - ), |
|
55 | - 'date_entered' => |
|
56 | - array ( |
|
54 | + ), |
|
55 | + 'date_entered' => |
|
56 | + array ( |
|
57 | 57 | 'name' => 'date_entered', |
58 | 58 | 'vname' => 'LBL_DATE_ENTERED', |
59 | 59 | 'type' => 'datetime', |
60 | 60 | 'required'=>true, |
61 | 61 | 'comment' => 'Date record created' |
62 | - ), |
|
63 | - 'date_modified' => |
|
64 | - array ( |
|
62 | + ), |
|
63 | + 'date_modified' => |
|
64 | + array ( |
|
65 | 65 | 'name' => 'date_modified', |
66 | 66 | 'vname' => 'LBL_DATE_MODIFIED', |
67 | 67 | 'type' => 'datetime', |
68 | 68 | 'required'=>true, |
69 | 69 | 'comment' => 'Date record last modified' |
70 | - ), |
|
70 | + ), |
|
71 | 71 | 'modified_user_id' => |
72 | - array ( |
|
72 | + array ( |
|
73 | 73 | 'name' => 'modified_user_id', |
74 | 74 | 'rname' => 'user_name', |
75 | 75 | 'id_name' => 'modified_user_id', |
@@ -82,9 +82,9 @@ discard block |
||
82 | 82 | 'len' => 36, |
83 | 83 | 'reportable'=>true, |
84 | 84 | 'comment' => 'User who last modified record' |
85 | - ), |
|
85 | + ), |
|
86 | 86 | 'created_by' => |
87 | - array ( |
|
87 | + array ( |
|
88 | 88 | 'name' => 'created_by', |
89 | 89 | 'rname' => 'user_name', |
90 | 90 | 'id_name' => 'created_by', |
@@ -95,63 +95,63 @@ discard block |
||
95 | 95 | 'dbType' => 'id', |
96 | 96 | 'len' => 36, |
97 | 97 | 'comment' => 'User ID who created record' |
98 | - ), |
|
99 | - 'name' => |
|
100 | - array ( |
|
98 | + ), |
|
99 | + 'name' => |
|
100 | + array ( |
|
101 | 101 | 'name' => 'name', |
102 | 102 | 'type' => 'varchar', |
103 | 103 | 'vname' => 'LBL_NAME', |
104 | 104 | 'len' => 150, |
105 | 105 | 'comment' => 'Name of the allowable action (view, list, delete, edit)' |
106 | - ), |
|
107 | - 'category' => |
|
108 | - array ( |
|
106 | + ), |
|
107 | + 'category' => |
|
108 | + array ( |
|
109 | 109 | 'name' => 'category', |
110 | 110 | 'vname' => 'LBL_CATEGORY', |
111 | 111 | 'type' => 'varchar', |
112 | - 'len' =>100, |
|
112 | + 'len' =>100, |
|
113 | 113 | 'reportable'=>true, |
114 | 114 | 'comment' => 'Category of the allowable action (usually the name of a module)' |
115 | - ), |
|
115 | + ), |
|
116 | 116 | 'acltype' => |
117 | - array ( |
|
117 | + array ( |
|
118 | 118 | 'name' => 'acltype', |
119 | 119 | 'vname' => 'LBL_TYPE', |
120 | 120 | 'type' => 'varchar', |
121 | - 'len' =>100, |
|
121 | + 'len' =>100, |
|
122 | 122 | 'reportable'=>true, |
123 | 123 | 'comment' => 'Specifier for Category, usually "module"' |
124 | - ), |
|
125 | - 'aclaccess' => |
|
126 | - array ( |
|
124 | + ), |
|
125 | + 'aclaccess' => |
|
126 | + array ( |
|
127 | 127 | 'name' => 'aclaccess', |
128 | 128 | 'vname' => 'LBL_ACCESS', |
129 | 129 | 'type' => 'int', |
130 | 130 | 'len'=>3, |
131 | 131 | 'reportable'=>true, |
132 | 132 | 'comment' => 'Number specifying access priority; highest access "wins"' |
133 | - ), |
|
134 | - 'deleted' => |
|
135 | - array ( |
|
133 | + ), |
|
134 | + 'deleted' => |
|
135 | + array ( |
|
136 | 136 | 'name' => 'deleted', |
137 | 137 | 'vname' => 'LBL_DELETED', |
138 | 138 | 'type' => 'bool', |
139 | 139 | 'reportable'=>false, |
140 | 140 | 'comment' => 'Record deletion indicator' |
141 | - ), |
|
142 | - 'roles' => |
|
143 | - array ( |
|
144 | - 'name' => 'roles', |
|
141 | + ), |
|
142 | + 'roles' => |
|
143 | + array ( |
|
144 | + 'name' => 'roles', |
|
145 | 145 | 'type' => 'link', |
146 | 146 | 'relationship' => 'acl_roles_actions', |
147 | 147 | 'source'=>'non-db', |
148 | - 'vname'=>'LBL_USERS', |
|
149 | - ), |
|
148 | + 'vname'=>'LBL_USERS', |
|
149 | + ), |
|
150 | 150 | ), |
151 | 151 | 'indices' => array ( |
152 | - array('name' =>'aclactionid', 'type' =>'primary', 'fields'=>array('id')), |
|
153 | - array('name' =>'idx_aclaction_id_del', 'type' =>'index', 'fields'=>array('id', 'deleted')), |
|
154 | - array('name' =>'idx_category_name', 'type' =>'index', 'fields'=>array('category', 'name')), ) |
|
152 | + array('name' =>'aclactionid', 'type' =>'primary', 'fields'=>array('id')), |
|
153 | + array('name' =>'idx_aclaction_id_del', 'type' =>'index', 'fields'=>array('id', 'deleted')), |
|
154 | + array('name' =>'idx_category_name', 'type' =>'index', 'fields'=>array('category', 'name')), ) |
|
155 | 155 | |
156 | 156 | ); |
157 | 157 | ?> |
158 | 158 | \ No newline at end of file |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | ********************************************************************************/ |
40 | 40 | /* BEGIN - SECURITY GROUPS */ |
41 | 41 | if(file_exists("modules/ACLActions/actiondefs.override.php")){ |
42 | - require_once("modules/ACLActions/actiondefs.override.php"); |
|
42 | + require_once("modules/ACLActions/actiondefs.override.php"); |
|
43 | 43 | } else { |
44 | 44 | require_once('modules/ACLActions/actiondefs.php'); |
45 | 45 | } |
@@ -55,12 +55,12 @@ discard block |
||
55 | 55 | } |
56 | 56 | |
57 | 57 | /** |
58 | - * static addActions($category, $type='module') |
|
59 | - * Adds all default actions for a category/type |
|
60 | - * |
|
61 | - * @param STRING $category - the category (e.g module name - Accounts, Contacts) |
|
62 | - * @param STRING $type - the type (e.g. 'module', 'field') |
|
63 | - */ |
|
58 | + * static addActions($category, $type='module') |
|
59 | + * Adds all default actions for a category/type |
|
60 | + * |
|
61 | + * @param STRING $category - the category (e.g module name - Accounts, Contacts) |
|
62 | + * @param STRING $type - the type (e.g. 'module', 'field') |
|
63 | + */ |
|
64 | 64 | static function addActions($category, $type='module'){ |
65 | 65 | global $ACLActions; |
66 | 66 | $db = DBManagerFactory::getInstance(); |
@@ -91,12 +91,12 @@ discard block |
||
91 | 91 | } |
92 | 92 | |
93 | 93 | /** |
94 | - * static removeActions($category, $type='module') |
|
95 | - * Removes all default actions for a category/type |
|
96 | - * |
|
97 | - * @param STRING $category - the category (e.g module name - Accounts, Contacts) |
|
98 | - * @param STRING $type - the type (e.g. 'module', 'field') |
|
99 | - */ |
|
94 | + * static removeActions($category, $type='module') |
|
95 | + * Removes all default actions for a category/type |
|
96 | + * |
|
97 | + * @param STRING $category - the category (e.g module name - Accounts, Contacts) |
|
98 | + * @param STRING $type - the type (e.g. 'module', 'field') |
|
99 | + */ |
|
100 | 100 | public static function removeActions($category, $type='module'){ |
101 | 101 | global $ACLActions; |
102 | 102 | $db = DBManagerFactory::getInstance(); |
@@ -118,13 +118,13 @@ discard block |
||
118 | 118 | } |
119 | 119 | |
120 | 120 | /** |
121 | - * static AccessColor($access) |
|
122 | - * |
|
123 | - * returns the color associated with an access level |
|
124 | - * these colors exist in the definitions in modules/ACLActions/actiondefs.php |
|
125 | - * @param INT $access - the access level you want the color for |
|
126 | - * @return the color either name or hex representation or false if the level does not exist |
|
127 | - */ |
|
121 | + * static AccessColor($access) |
|
122 | + * |
|
123 | + * returns the color associated with an access level |
|
124 | + * these colors exist in the definitions in modules/ACLActions/actiondefs.php |
|
125 | + * @param INT $access - the access level you want the color for |
|
126 | + * @return the color either name or hex representation or false if the level does not exist |
|
127 | + */ |
|
128 | 128 | protected static function AccessColor($access){ |
129 | 129 | global $ACLActionAccessLevels; |
130 | 130 | if(isset($ACLActionAccessLevels[$access])){ |
@@ -136,13 +136,13 @@ discard block |
||
136 | 136 | } |
137 | 137 | |
138 | 138 | /** |
139 | - * static AccessName($access) |
|
140 | - * |
|
141 | - * returns the translated name associated with an access level |
|
142 | - * these label definitions exist in the definitions in modules/ACLActions/actiondefs.php |
|
143 | - * @param INT $access - the access level you want the color for |
|
144 | - * @return the translated access level name or false if the level does not exist |
|
145 | - */ |
|
139 | + * static AccessName($access) |
|
140 | + * |
|
141 | + * returns the translated name associated with an access level |
|
142 | + * these label definitions exist in the definitions in modules/ACLActions/actiondefs.php |
|
143 | + * @param INT $access - the access level you want the color for |
|
144 | + * @return the translated access level name or false if the level does not exist |
|
145 | + */ |
|
146 | 146 | static function AccessName($access){ |
147 | 147 | global $ACLActionAccessLevels; |
148 | 148 | if(isset($ACLActionAccessLevels[$access])){ |
@@ -172,10 +172,10 @@ discard block |
||
172 | 172 | } |
173 | 173 | |
174 | 174 | /** |
175 | - * static getAccessOptions() |
|
176 | - * this is used for building select boxes |
|
177 | - * @return array containg access levels (ints) as keys and access names as values |
|
178 | - */ |
|
175 | + * static getAccessOptions() |
|
176 | + * this is used for building select boxes |
|
177 | + * @return array containg access levels (ints) as keys and access names as values |
|
178 | + */ |
|
179 | 179 | protected static function getAccessOptions( $action, $type='module'){ |
180 | 180 | global $ACLActions; |
181 | 181 | $options = array(); |
@@ -189,11 +189,11 @@ discard block |
||
189 | 189 | } |
190 | 190 | |
191 | 191 | /** |
192 | - * function static getDefaultActions() |
|
193 | - * This function will return a list of acl actions with their default access levels |
|
194 | - * |
|
195 | - * |
|
196 | - */ |
|
192 | + * function static getDefaultActions() |
|
193 | + * This function will return a list of acl actions with their default access levels |
|
194 | + * |
|
195 | + * |
|
196 | + */ |
|
197 | 197 | public static function getDefaultActions($type='module', $action=''){ |
198 | 198 | $query = "SELECT * FROM acl_actions WHERE deleted=0 "; |
199 | 199 | if(!empty($type)){ |
@@ -217,14 +217,14 @@ discard block |
||
217 | 217 | |
218 | 218 | |
219 | 219 | /** |
220 | - * static getUserActions($user_id,$refresh=false, $category='', $action='') |
|
221 | - * returns a list of user actions |
|
222 | - * @param GUID $user_id |
|
223 | - * @param BOOLEAN $refresh |
|
224 | - * @param STRING $category |
|
225 | - * @param STRING $action |
|
226 | - * @return ARRAY of ACLActionsArray |
|
227 | - */ |
|
220 | + * static getUserActions($user_id,$refresh=false, $category='', $action='') |
|
221 | + * returns a list of user actions |
|
222 | + * @param GUID $user_id |
|
223 | + * @param BOOLEAN $refresh |
|
224 | + * @param STRING $category |
|
225 | + * @param STRING $action |
|
226 | + * @return ARRAY of ACLActionsArray |
|
227 | + */ |
|
228 | 228 | |
229 | 229 | static function getUserActions($user_id,$refresh=false, $category='',$type='', $action=''){ |
230 | 230 | //check in the session if we already have it loaded |
@@ -256,15 +256,15 @@ discard block |
||
256 | 256 | if(!empty($type)){ |
257 | 257 | $additional_where .= " AND acl_actions.acltype = '$type' "; |
258 | 258 | } |
259 | - /* BEGIN - SECURITY GROUPS */ |
|
260 | - /** |
|
259 | + /* BEGIN - SECURITY GROUPS */ |
|
260 | + /** |
|
261 | 261 | $query = "SELECT acl_actions .*, acl_roles_actions.access_override |
262 | 262 | FROM acl_actions |
263 | 263 | LEFT JOIN acl_roles_users ON acl_roles_users.user_id = '$user_id' AND acl_roles_users.deleted = 0 |
264 | 264 | LEFT JOIN acl_roles_actions ON acl_roles_actions.role_id = acl_roles_users.role_id AND acl_roles_actions.action_id = acl_actions.id AND acl_roles_actions.deleted=0 |
265 | 265 | WHERE acl_actions.deleted=0 $additional_where ORDER BY category,name"; |
266 | - */ |
|
267 | - $query = "(SELECT acl_actions .*, acl_roles_actions.access_override, 1 as user_role |
|
266 | + */ |
|
267 | + $query = "(SELECT acl_actions .*, acl_roles_actions.access_override, 1 as user_role |
|
268 | 268 | FROM acl_actions |
269 | 269 | INNER JOIN acl_roles_users ON acl_roles_users.user_id = '$user_id' AND acl_roles_users.deleted = 0 |
270 | 270 | LEFT JOIN acl_roles_actions ON acl_roles_actions.role_id = acl_roles_users.role_id AND acl_roles_actions.action_id = acl_actions.id AND acl_roles_actions.deleted=0 |
@@ -286,34 +286,34 @@ discard block |
||
286 | 286 | WHERE acl_actions.deleted = 0 ) |
287 | 287 | |
288 | 288 | ORDER BY user_role desc, category,name,access_override desc"; //want non-null to show first |
289 | - /* END - SECURITY GROUPS */ |
|
289 | + /* END - SECURITY GROUPS */ |
|
290 | 290 | $result = $db->query($query); |
291 | 291 | $selected_actions = array(); |
292 | - /* BEGIN - SECURITY GROUPS */ |
|
293 | - global $sugar_config; |
|
294 | - $has_user_role = false; //used for user_role_precedence |
|
295 | - $has_role = false; //used to determine if default actions can be ignored. If a user has a defined role don't use the defaults |
|
296 | - /* END - SECURITY GROUPS */ |
|
292 | + /* BEGIN - SECURITY GROUPS */ |
|
293 | + global $sugar_config; |
|
294 | + $has_user_role = false; //used for user_role_precedence |
|
295 | + $has_role = false; //used to determine if default actions can be ignored. If a user has a defined role don't use the defaults |
|
296 | + /* END - SECURITY GROUPS */ |
|
297 | 297 | while($row = $db->fetchByAssoc($result, FALSE) ){ |
298 | - /* BEGIN - SECURITY GROUPS */ |
|
299 | - if($has_user_role == false && $row['user_role'] == 1) { |
|
300 | - $has_user_role = true; |
|
301 | - } |
|
302 | - if($has_role == false && ($row['user_role'] == 1 || $row['user_role'] ==0)) { |
|
303 | - $has_role = true; |
|
304 | - } |
|
305 | - //if user roles should take precedence over group roles and we have a user role |
|
306 | - //break when we get to processing the group roles |
|
307 | - if($has_user_role == true && $row['user_role'] == 0 |
|
308 | - && isset($sugar_config['securitysuite_user_role_precedence']) |
|
309 | - && $sugar_config['securitysuite_user_role_precedence'] == true ) |
|
310 | - { |
|
311 | - break; |
|
312 | - } |
|
313 | - if($row['user_role'] == -1 && $has_role == true) { |
|
314 | - break; //no need for default actions when a role is assigned to the user or user's group already |
|
315 | - } |
|
316 | - /* END - SECURITY GROUPS */ |
|
298 | + /* BEGIN - SECURITY GROUPS */ |
|
299 | + if($has_user_role == false && $row['user_role'] == 1) { |
|
300 | + $has_user_role = true; |
|
301 | + } |
|
302 | + if($has_role == false && ($row['user_role'] == 1 || $row['user_role'] ==0)) { |
|
303 | + $has_role = true; |
|
304 | + } |
|
305 | + //if user roles should take precedence over group roles and we have a user role |
|
306 | + //break when we get to processing the group roles |
|
307 | + if($has_user_role == true && $row['user_role'] == 0 |
|
308 | + && isset($sugar_config['securitysuite_user_role_precedence']) |
|
309 | + && $sugar_config['securitysuite_user_role_precedence'] == true ) |
|
310 | + { |
|
311 | + break; |
|
312 | + } |
|
313 | + if($row['user_role'] == -1 && $has_role == true) { |
|
314 | + break; //no need for default actions when a role is assigned to the user or user's group already |
|
315 | + } |
|
316 | + /* END - SECURITY GROUPS */ |
|
317 | 317 | $acl = new ACLAction(); |
318 | 318 | $isOverride = false; |
319 | 319 | $acl->populateFromRow($row); |
@@ -326,16 +326,16 @@ discard block |
||
326 | 326 | |
327 | 327 | } |
328 | 328 | if(!isset($selected_actions[$acl->category][$acl->acltype][$acl->name]) |
329 | - || ( |
|
330 | - /* BEGIN - SECURITY GROUPS - additive security*/ |
|
331 | - ( |
|
332 | - (isset($sugar_config['securitysuite_additive']) && $sugar_config['securitysuite_additive'] == true |
|
333 | - && $selected_actions[$acl->category][$acl->acltype][$acl->name]['aclaccess'] < $acl->aclaccess) |
|
334 | - || |
|
335 | - ((!isset($sugar_config['securitysuite_additive']) || $sugar_config['securitysuite_additive'] == false) |
|
336 | - && $selected_actions[$acl->category][$acl->acltype][$acl->name]['aclaccess'] > $acl->aclaccess) |
|
337 | - ) |
|
338 | - /* END - SECURITY GROUPS */ |
|
329 | + || ( |
|
330 | + /* BEGIN - SECURITY GROUPS - additive security*/ |
|
331 | + ( |
|
332 | + (isset($sugar_config['securitysuite_additive']) && $sugar_config['securitysuite_additive'] == true |
|
333 | + && $selected_actions[$acl->category][$acl->acltype][$acl->name]['aclaccess'] < $acl->aclaccess) |
|
334 | + || |
|
335 | + ((!isset($sugar_config['securitysuite_additive']) || $sugar_config['securitysuite_additive'] == false) |
|
336 | + && $selected_actions[$acl->category][$acl->acltype][$acl->name]['aclaccess'] > $acl->aclaccess) |
|
337 | + ) |
|
338 | + /* END - SECURITY GROUPS */ |
|
339 | 339 | && $isOverride |
340 | 340 | ) |
341 | 341 | || |
@@ -388,70 +388,70 @@ discard block |
||
388 | 388 | } |
389 | 389 | |
390 | 390 | /** |
391 | - * (static/ non-static)function hasAccess($is_owner= false , $access = 0) |
|
392 | - * checks if a user has access to this acl if the user is an owner it will check if owners have access |
|
393 | - * |
|
394 | - * This function may either be used statically or not. If used staticlly a user must pass in an access level not equal to zero |
|
395 | - * @param boolean $is_owner |
|
396 | - * @param int $access |
|
397 | - * @return true or false |
|
398 | - */ |
|
399 | - /* BEGIN - SECURITY GROUPS */ |
|
400 | - /** |
|
391 | + * (static/ non-static)function hasAccess($is_owner= false , $access = 0) |
|
392 | + * checks if a user has access to this acl if the user is an owner it will check if owners have access |
|
393 | + * |
|
394 | + * This function may either be used statically or not. If used staticlly a user must pass in an access level not equal to zero |
|
395 | + * @param boolean $is_owner |
|
396 | + * @param int $access |
|
397 | + * @return true or false |
|
398 | + */ |
|
399 | + /* BEGIN - SECURITY GROUPS */ |
|
400 | + /** |
|
401 | 401 | static function hasAccess($is_owner=false, $access = 0){ |
402 | - */ |
|
403 | - static function hasAccess($is_owner=false, $in_group=false, $access = 0){ |
|
404 | - /** |
|
402 | + */ |
|
403 | + static function hasAccess($is_owner=false, $in_group=false, $access = 0){ |
|
404 | + /** |
|
405 | 405 | if($access != 0 && $access == ACL_ALLOW_ALL || ($is_owner && $access == ACL_ALLOW_OWNER))return true; |
406 | 406 | //if this exists, then this function is not static, so check the aclaccess parameter |
407 | 407 | if(isset($this) && isset($this->aclaccess)){ |
408 | 408 | if($this->aclaccess == ACL_ALLOW_ALL || ($is_owner && $this->aclaccess == ACL_ALLOW_OWNER)) |
409 | 409 | return true; |
410 | 410 | } |
411 | - */ |
|
412 | - if($access != 0 && ($access == ACL_ALLOW_ALL |
|
413 | - || ($is_owner && ($access == ACL_ALLOW_OWNER || $access == ACL_ALLOW_GROUP) ) //if owner that's better than in group so count it...better way to clean this up? |
|
414 | - || ($in_group && $access == ACL_ALLOW_GROUP) //need to pass if in group with access somehow |
|
415 | - )) { |
|
416 | - return true; |
|
417 | - } |
|
411 | + */ |
|
412 | + if($access != 0 && ($access == ACL_ALLOW_ALL |
|
413 | + || ($is_owner && ($access == ACL_ALLOW_OWNER || $access == ACL_ALLOW_GROUP) ) //if owner that's better than in group so count it...better way to clean this up? |
|
414 | + || ($in_group && $access == ACL_ALLOW_GROUP) //need to pass if in group with access somehow |
|
415 | + )) { |
|
416 | + return true; |
|
417 | + } |
|
418 | 418 | if(isset($this) && isset($this->aclaccess)){ |
419 | - if($this->aclaccess == ACL_ALLOW_ALL |
|
420 | - || ($is_owner && $this->aclaccess == ($access == ACL_ALLOW_OWNER || $access == ACL_ALLOW_GROUP)) |
|
421 | - || ($in_group && $access == ACL_ALLOW_GROUP) //need to pass if in group with access somehow |
|
422 | - ) { |
|
423 | - return true; |
|
424 | - } |
|
425 | - } |
|
419 | + if($this->aclaccess == ACL_ALLOW_ALL |
|
420 | + || ($is_owner && $this->aclaccess == ($access == ACL_ALLOW_OWNER || $access == ACL_ALLOW_GROUP)) |
|
421 | + || ($in_group && $access == ACL_ALLOW_GROUP) //need to pass if in group with access somehow |
|
422 | + ) { |
|
423 | + return true; |
|
424 | + } |
|
425 | + } |
|
426 | 426 | return false; |
427 | 427 | } |
428 | - /* END - SECURITY GROUPS */ |
|
429 | - |
|
430 | - /* BEGIN - SECURITY GROUPS */ |
|
431 | - /** |
|
432 | - * STATIC function userNeedsSecurityGroup($user_id, $category, $action,$type='module') |
|
433 | - * checks if a user should have ownership to do an action |
|
434 | - * |
|
435 | - * @param GUID $user_id |
|
436 | - * @param STRING $category |
|
437 | - * @param STRING $action |
|
438 | - * @param STRING $type |
|
439 | - * @return boolean |
|
440 | - */ |
|
441 | - static function userNeedsSecurityGroup($user_id, $category, $action,$type='module'){ |
|
442 | - //check if we don't have it set in the cache if not lets reload the cache |
|
428 | + /* END - SECURITY GROUPS */ |
|
429 | + |
|
430 | + /* BEGIN - SECURITY GROUPS */ |
|
431 | + /** |
|
432 | + * STATIC function userNeedsSecurityGroup($user_id, $category, $action,$type='module') |
|
433 | + * checks if a user should have ownership to do an action |
|
434 | + * |
|
435 | + * @param GUID $user_id |
|
436 | + * @param STRING $category |
|
437 | + * @param STRING $action |
|
438 | + * @param STRING $type |
|
439 | + * @return boolean |
|
440 | + */ |
|
441 | + static function userNeedsSecurityGroup($user_id, $category, $action,$type='module'){ |
|
442 | + //check if we don't have it set in the cache if not lets reload the cache |
|
443 | 443 | |
444 | - if(empty($_SESSION['ACL'][$user_id][$category][$type][$action])){ |
|
445 | - ACLAction::getUserActions($user_id, false); |
|
444 | + if(empty($_SESSION['ACL'][$user_id][$category][$type][$action])){ |
|
445 | + ACLAction::getUserActions($user_id, false); |
|
446 | 446 | |
447 | - } |
|
447 | + } |
|
448 | 448 | |
449 | - if(!empty($_SESSION['ACL'][$user_id][$category][$type][$action])){ |
|
450 | - return $_SESSION['ACL'][$user_id][$category][$type][$action]['aclaccess'] == ACL_ALLOW_GROUP; |
|
451 | - } |
|
449 | + if(!empty($_SESSION['ACL'][$user_id][$category][$type][$action])){ |
|
450 | + return $_SESSION['ACL'][$user_id][$category][$type][$action]['aclaccess'] == ACL_ALLOW_GROUP; |
|
451 | + } |
|
452 | 452 | return false; |
453 | 453 | } |
454 | - /* END - SECURITY GROUPS */ |
|
454 | + /* END - SECURITY GROUPS */ |
|
455 | 455 | |
456 | 456 | |
457 | 457 | |
@@ -461,20 +461,20 @@ discard block |
||
461 | 461 | |
462 | 462 | |
463 | 463 | /** |
464 | - * static function userHasAccess($user_id, $category, $action, $is_owner = false) |
|
465 | - * |
|
466 | - * @param GUID $user_id the user id who you want to check access for |
|
467 | - * @param STRING $category the category you would like to check access for |
|
468 | - * @param STRING $action the action of that category you would like to check access for |
|
469 | - * @param BOOLEAN OPTIONAL $is_owner if the object is owned by the user you are checking access for |
|
470 | - */ |
|
471 | - /* BEGIN - SECURITY GROUPS - added $in_group */ |
|
472 | - /** |
|
464 | + * static function userHasAccess($user_id, $category, $action, $is_owner = false) |
|
465 | + * |
|
466 | + * @param GUID $user_id the user id who you want to check access for |
|
467 | + * @param STRING $category the category you would like to check access for |
|
468 | + * @param STRING $action the action of that category you would like to check access for |
|
469 | + * @param BOOLEAN OPTIONAL $is_owner if the object is owned by the user you are checking access for |
|
470 | + */ |
|
471 | + /* BEGIN - SECURITY GROUPS - added $in_group */ |
|
472 | + /** |
|
473 | 473 | public static function userHasAccess($user_id, $category, $action,$type='module', $is_owner = false){ |
474 | - */ |
|
475 | - public static function userHasAccess($user_id, $category, $action,$type='module', $is_owner = false, $in_group = false){ |
|
476 | - global $current_user; |
|
477 | - if($current_user->isAdminForModule($category)&& !isset($_SESSION['ACL'][$user_id][$category][$type][$action]['aclaccess'])){ |
|
474 | + */ |
|
475 | + public static function userHasAccess($user_id, $category, $action,$type='module', $is_owner = false, $in_group = false){ |
|
476 | + global $current_user; |
|
477 | + if($current_user->isAdminForModule($category)&& !isset($_SESSION['ACL'][$user_id][$category][$type][$action]['aclaccess'])){ |
|
478 | 478 | return true; |
479 | 479 | } |
480 | 480 | //check if we don't have it set in the cache if not lets reload the cache |
@@ -488,22 +488,22 @@ discard block |
||
488 | 488 | /** |
489 | 489 | return ACLAction::hasAccess($is_owner, $_SESSION['ACL'][$user_id][$category][$type][$action]['aclaccess']); |
490 | 490 | */ |
491 | - return ACLAction::hasAccess($is_owner, $in_group, $_SESSION['ACL'][$user_id][$category][$type][$action]['aclaccess']); |
|
491 | + return ACLAction::hasAccess($is_owner, $in_group, $_SESSION['ACL'][$user_id][$category][$type][$action]['aclaccess']); |
|
492 | 492 | } |
493 | 493 | return false; |
494 | 494 | |
495 | 495 | } |
496 | - /* END - SECURITY GROUPS */ |
|
496 | + /* END - SECURITY GROUPS */ |
|
497 | 497 | /** |
498 | - * function getUserAccessLevel($user_id, $category, $action,$type='module') |
|
499 | - * returns the access level for a given category and action |
|
500 | - * |
|
501 | - * @param GUID $user_id |
|
502 | - * @param STRING $category |
|
503 | - * @param STRING $action |
|
504 | - * @param STRING $type |
|
505 | - * @return INT (ACCESS LEVEL) |
|
506 | - */ |
|
498 | + * function getUserAccessLevel($user_id, $category, $action,$type='module') |
|
499 | + * returns the access level for a given category and action |
|
500 | + * |
|
501 | + * @param GUID $user_id |
|
502 | + * @param STRING $category |
|
503 | + * @param STRING $action |
|
504 | + * @param STRING $type |
|
505 | + * @return INT (ACCESS LEVEL) |
|
506 | + */ |
|
507 | 507 | public static function getUserAccessLevel($user_id, $category, $action,$type='module'){ |
508 | 508 | if(empty($_SESSION['ACL'][$user_id][$category][$type][$action])){ |
509 | 509 | ACLAction::getUserActions($user_id, false); |
@@ -520,15 +520,15 @@ discard block |
||
520 | 520 | } |
521 | 521 | |
522 | 522 | /** |
523 | - * STATIC function userNeedsOwnership($user_id, $category, $action,$type='module') |
|
524 | - * checks if a user should have ownership to do an action |
|
525 | - * |
|
526 | - * @param GUID $user_id |
|
527 | - * @param STRING $category |
|
528 | - * @param STRING $action |
|
529 | - * @param STRING $type |
|
530 | - * @return boolean |
|
531 | - */ |
|
523 | + * STATIC function userNeedsOwnership($user_id, $category, $action,$type='module') |
|
524 | + * checks if a user should have ownership to do an action |
|
525 | + * |
|
526 | + * @param GUID $user_id |
|
527 | + * @param STRING $category |
|
528 | + * @param STRING $action |
|
529 | + * @param STRING $type |
|
530 | + * @return boolean |
|
531 | + */ |
|
532 | 532 | public static function userNeedsOwnership($user_id, $category, $action,$type='module'){ |
533 | 533 | //check if we don't have it set in the cache if not lets reload the cache |
534 | 534 | |
@@ -545,12 +545,12 @@ discard block |
||
545 | 545 | |
546 | 546 | } |
547 | 547 | /** |
548 | - * |
|
549 | - * static pass by ref setupCategoriesMatrix(&$categories) |
|
550 | - * takes in an array of categories and modifes them adding display information |
|
551 | - * |
|
552 | - * @param unknown_type $categories |
|
553 | - */ |
|
548 | + * |
|
549 | + * static pass by ref setupCategoriesMatrix(&$categories) |
|
550 | + * takes in an array of categories and modifes them adding display information |
|
551 | + * |
|
552 | + * @param unknown_type $categories |
|
553 | + */ |
|
554 | 554 | public static function setupCategoriesMatrix(&$categories){ |
555 | 555 | global $ACLActions, $current_user; |
556 | 556 | $names = array(); |
@@ -593,11 +593,11 @@ discard block |
||
593 | 593 | |
594 | 594 | |
595 | 595 | /** |
596 | - * function toArray() |
|
597 | - * returns this acl as an array |
|
598 | - * |
|
599 | - * @return array of fields with id, name, access and category |
|
600 | - */ |
|
596 | + * function toArray() |
|
597 | + * returns this acl as an array |
|
598 | + * |
|
599 | + * @return array of fields with id, name, access and category |
|
600 | + */ |
|
601 | 601 | function toArray($dbOnly = false, $stringOnly = false, $upperKeys = false){ |
602 | 602 | $array_fields = array('id', 'aclaccess'); |
603 | 603 | $arr = array(); |
@@ -608,11 +608,11 @@ discard block |
||
608 | 608 | } |
609 | 609 | |
610 | 610 | /** |
611 | - * function fromArray($arr) |
|
612 | - * converts an array into an acl mapping name value pairs into files |
|
613 | - * |
|
614 | - * @param Array $arr |
|
615 | - */ |
|
611 | + * function fromArray($arr) |
|
612 | + * converts an array into an acl mapping name value pairs into files |
|
613 | + * |
|
614 | + * @param Array $arr |
|
615 | + */ |
|
616 | 616 | function fromArray($arr){ |
617 | 617 | foreach($arr as $name=>$value){ |
618 | 618 | $this->$name = $value; |
@@ -620,10 +620,10 @@ discard block |
||
620 | 620 | } |
621 | 621 | |
622 | 622 | /** |
623 | - * function clearSessionCache() |
|
624 | - * clears the session variable storing the cache information for acls |
|
625 | - * |
|
626 | - */ |
|
623 | + * function clearSessionCache() |
|
624 | + * clears the session variable storing the cache information for acls |
|
625 | + * |
|
626 | + */ |
|
627 | 627 | function clearSessionCache(){ |
628 | 628 | unset($_SESSION['ACL']); |
629 | 629 | } |
@@ -40,8 +40,8 @@ |
||
40 | 40 | |
41 | 41 | global $mod_strings; |
42 | 42 | $module_menu = Array( |
43 | - Array("index.php?module=ACLRoles&action=index", $mod_strings['LIST_ROLES'],"Roles"), |
|
44 | - Array("index.php?module=ACLRoles&action=ListUsers", $mod_strings['LIST_ROLES_BY_USER'],"Roles"), |
|
43 | + Array("index.php?module=ACLRoles&action=index", $mod_strings['LIST_ROLES'],"Roles"), |
|
44 | + Array("index.php?module=ACLRoles&action=ListUsers", $mod_strings['LIST_ROLES_BY_USER'],"Roles"), |
|
45 | 45 | |
46 | - ); |
|
46 | + ); |
|
47 | 47 | ?> |
48 | 48 | \ No newline at end of file |
@@ -42,33 +42,33 @@ |
||
42 | 42 | |
43 | 43 | |
44 | 44 | $layout_defs['ACL'] = array( |
45 | - // sets up which panels to show, in which order, and with what linked_fields |
|
46 | - 'subpanel_setup' => array( |
|
45 | + // sets up which panels to show, in which order, and with what linked_fields |
|
46 | + 'subpanel_setup' => array( |
|
47 | 47 | 'users' => array( |
48 | - 'top_buttons' => array( array('widget_class' => 'SubPanelTopSubModuleSelectButton', 'popup_module' => 'Users'),), |
|
49 | - 'order' => 20, |
|
50 | - 'module' => 'Users', |
|
51 | - 'subpanel_name' => 'ForSubModules', |
|
52 | - 'get_subpanel_data' => 'users', |
|
53 | - 'add_subpanel_data' => 'user_id', |
|
54 | - 'title_key' => 'LBL_USERS_SUBPANEL_TITLE', |
|
55 | - ), |
|
56 | - ), |
|
48 | + 'top_buttons' => array( array('widget_class' => 'SubPanelTopSubModuleSelectButton', 'popup_module' => 'Users'),), |
|
49 | + 'order' => 20, |
|
50 | + 'module' => 'Users', |
|
51 | + 'subpanel_name' => 'ForSubModules', |
|
52 | + 'get_subpanel_data' => 'users', |
|
53 | + 'add_subpanel_data' => 'user_id', |
|
54 | + 'title_key' => 'LBL_USERS_SUBPANEL_TITLE', |
|
55 | + ), |
|
56 | + ), |
|
57 | 57 | ); |
58 | 58 | $layout_defs['UserRoles'] = array( |
59 | - // sets up which panels to show, in which order, and with what linked_fields |
|
60 | - 'subpanel_setup' => array( |
|
59 | + // sets up which panels to show, in which order, and with what linked_fields |
|
60 | + 'subpanel_setup' => array( |
|
61 | 61 | 'acl' => array( |
62 | - 'top_buttons' => array(array('widget_class' => 'SubPanelTopSubModuleSelectButton', 'popup_module' => 'ACL'),), |
|
63 | - 'order' => 20, |
|
64 | - 'module' => 'ACL', |
|
65 | - 'subpanel_def_path'=>'modules/ACL/Roles/subpanels/default.php', |
|
66 | - 'subpanel_name' => 'default', |
|
67 | - 'get_subpanel_data' => 'roles', |
|
68 | - 'add_subpanel_data' => 'role_id', |
|
69 | - 'title_key' => 'LBL_ROLES_SUBPANEL_TITLE', |
|
70 | - ), |
|
71 | - ), |
|
62 | + 'top_buttons' => array(array('widget_class' => 'SubPanelTopSubModuleSelectButton', 'popup_module' => 'ACL'),), |
|
63 | + 'order' => 20, |
|
64 | + 'module' => 'ACL', |
|
65 | + 'subpanel_def_path'=>'modules/ACL/Roles/subpanels/default.php', |
|
66 | + 'subpanel_name' => 'default', |
|
67 | + 'get_subpanel_data' => 'roles', |
|
68 | + 'add_subpanel_data' => 'role_id', |
|
69 | + 'title_key' => 'LBL_ROLES_SUBPANEL_TITLE', |
|
70 | + ), |
|
71 | + ), |
|
72 | 72 | |
73 | 73 | ); |
74 | 74 |
@@ -38,96 +38,96 @@ |
||
38 | 38 | * display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM". |
39 | 39 | ********************************************************************************/ |
40 | 40 | |
41 | - if(!defined('ACL_ALLOW_NONE')){ |
|
42 | - define('ACL_ALLOW_ADMIN_DEV', 100); |
|
43 | - define('ACL_ALLOW_ADMIN', 99); |
|
44 | - define('ACL_ALLOW_ALL', 90); |
|
45 | - define('ACL_ALLOW_ENABLED', 89); |
|
46 | - define('ACL_ALLOW_OWNER', 75); |
|
47 | - define('ACL_ALLOW_NORMAL', 1); |
|
48 | - define('ACL_ALLOW_DEFAULT', 0); |
|
49 | - define('ACL_ALLOW_DISABLED', -98); |
|
50 | - define('ACL_ALLOW_NONE', -99); |
|
51 | - define('ACL_ALLOW_DEV', 95); |
|
52 | - } |
|
53 | - /** |
|
54 | - * $GLOBALS['ACLActionAccessLevels |
|
55 | - * these are rendering descriptions for Access Levels giving information such as the label, color, and text color to use when rendering the access level |
|
56 | - */ |
|
57 | - $GLOBALS['ACLActionAccessLevels'] = array( |
|
58 | - ACL_ALLOW_ALL=>array('color'=>'#008000', 'label'=>'LBL_ACCESS_ALL', 'text_color'=>'white'), |
|
59 | - ACL_ALLOW_OWNER=>array('color'=>'#6F6800', 'label'=>'LBL_ACCESS_OWNER', 'text_color'=>'white'), |
|
60 | - ACL_ALLOW_NONE=>array('color'=>'#FF0000', 'label'=>'LBL_ACCESS_NONE', 'text_color'=>'white'), |
|
61 | - ACL_ALLOW_ENABLED=>array('color'=>'#008000', 'label'=>'LBL_ACCESS_ENABLED', 'text_color'=>'white'), |
|
62 | - ACL_ALLOW_DISABLED=>array('color'=>'#FF0000', 'label'=>'LBL_ACCESS_DISABLED', 'text_color'=>'white'), |
|
63 | - ACL_ALLOW_ADMIN=>array('color'=>'#0000FF', 'label'=>'LBL_ACCESS_ADMIN', 'text_color'=>'white'), |
|
64 | - ACL_ALLOW_NORMAL=>array('color'=>'#008000', 'label'=>'LBL_ACCESS_NORMAL', 'text_color'=>'white'), |
|
65 | - ACL_ALLOW_DEFAULT=>array('color'=>'#008000', 'label'=>'LBL_ACCESS_DEFAULT', 'text_color'=>'white'), |
|
66 | - ACL_ALLOW_DEV=>array('color'=>'#0000FF', 'label'=>'LBL_ACCESS_DEV', 'text_color'=>'white'), |
|
67 | - ACL_ALLOW_ADMIN_DEV=>array('color'=>'#0000FF', 'label'=>'LBL_ACCESS_ADMIN_DEV', 'text_color'=>'white'), |
|
68 | - ); |
|
41 | + if(!defined('ACL_ALLOW_NONE')){ |
|
42 | + define('ACL_ALLOW_ADMIN_DEV', 100); |
|
43 | + define('ACL_ALLOW_ADMIN', 99); |
|
44 | + define('ACL_ALLOW_ALL', 90); |
|
45 | + define('ACL_ALLOW_ENABLED', 89); |
|
46 | + define('ACL_ALLOW_OWNER', 75); |
|
47 | + define('ACL_ALLOW_NORMAL', 1); |
|
48 | + define('ACL_ALLOW_DEFAULT', 0); |
|
49 | + define('ACL_ALLOW_DISABLED', -98); |
|
50 | + define('ACL_ALLOW_NONE', -99); |
|
51 | + define('ACL_ALLOW_DEV', 95); |
|
52 | + } |
|
53 | + /** |
|
54 | + * $GLOBALS['ACLActionAccessLevels |
|
55 | + * these are rendering descriptions for Access Levels giving information such as the label, color, and text color to use when rendering the access level |
|
56 | + */ |
|
57 | + $GLOBALS['ACLActionAccessLevels'] = array( |
|
58 | + ACL_ALLOW_ALL=>array('color'=>'#008000', 'label'=>'LBL_ACCESS_ALL', 'text_color'=>'white'), |
|
59 | + ACL_ALLOW_OWNER=>array('color'=>'#6F6800', 'label'=>'LBL_ACCESS_OWNER', 'text_color'=>'white'), |
|
60 | + ACL_ALLOW_NONE=>array('color'=>'#FF0000', 'label'=>'LBL_ACCESS_NONE', 'text_color'=>'white'), |
|
61 | + ACL_ALLOW_ENABLED=>array('color'=>'#008000', 'label'=>'LBL_ACCESS_ENABLED', 'text_color'=>'white'), |
|
62 | + ACL_ALLOW_DISABLED=>array('color'=>'#FF0000', 'label'=>'LBL_ACCESS_DISABLED', 'text_color'=>'white'), |
|
63 | + ACL_ALLOW_ADMIN=>array('color'=>'#0000FF', 'label'=>'LBL_ACCESS_ADMIN', 'text_color'=>'white'), |
|
64 | + ACL_ALLOW_NORMAL=>array('color'=>'#008000', 'label'=>'LBL_ACCESS_NORMAL', 'text_color'=>'white'), |
|
65 | + ACL_ALLOW_DEFAULT=>array('color'=>'#008000', 'label'=>'LBL_ACCESS_DEFAULT', 'text_color'=>'white'), |
|
66 | + ACL_ALLOW_DEV=>array('color'=>'#0000FF', 'label'=>'LBL_ACCESS_DEV', 'text_color'=>'white'), |
|
67 | + ACL_ALLOW_ADMIN_DEV=>array('color'=>'#0000FF', 'label'=>'LBL_ACCESS_ADMIN_DEV', 'text_color'=>'white'), |
|
68 | + ); |
|
69 | 69 | /** |
70 | - * $GLOBALS['ACLActions |
|
71 | - * These are the actions for a given type. It includes the ACCESS Levels for that action and the label for that action. Every an object of the category (e.g. module) is added all associated actions are added for that object |
|
72 | - */ |
|
70 | + * $GLOBALS['ACLActions |
|
71 | + * These are the actions for a given type. It includes the ACCESS Levels for that action and the label for that action. Every an object of the category (e.g. module) is added all associated actions are added for that object |
|
72 | + */ |
|
73 | 73 | $GLOBALS['ACLActions'] = array( |
74 | - 'module'=>array('actions'=> |
|
75 | - array( |
|
76 | - 'access'=> |
|
77 | - array( |
|
78 | - 'aclaccess'=>array(ACL_ALLOW_ENABLED,ACL_ALLOW_DEFAULT, ACL_ALLOW_DISABLED), |
|
79 | - 'label'=>'LBL_ACTION_ACCESS', |
|
80 | - 'default'=>ACL_ALLOW_ENABLED, |
|
81 | - ), |
|
74 | + 'module'=>array('actions'=> |
|
75 | + array( |
|
76 | + 'access'=> |
|
77 | + array( |
|
78 | + 'aclaccess'=>array(ACL_ALLOW_ENABLED,ACL_ALLOW_DEFAULT, ACL_ALLOW_DISABLED), |
|
79 | + 'label'=>'LBL_ACTION_ACCESS', |
|
80 | + 'default'=>ACL_ALLOW_ENABLED, |
|
81 | + ), |
|
82 | 82 | |
83 | - 'view'=> |
|
84 | - array( |
|
85 | - 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_OWNER,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
86 | - 'label'=>'LBL_ACTION_VIEW', |
|
87 | - 'default'=>ACL_ALLOW_ALL, |
|
88 | - ), |
|
83 | + 'view'=> |
|
84 | + array( |
|
85 | + 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_OWNER,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
86 | + 'label'=>'LBL_ACTION_VIEW', |
|
87 | + 'default'=>ACL_ALLOW_ALL, |
|
88 | + ), |
|
89 | 89 | |
90 | - 'list'=> |
|
91 | - array( |
|
92 | - 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_OWNER,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
93 | - 'label'=>'LBL_ACTION_LIST', |
|
94 | - 'default'=>ACL_ALLOW_ALL, |
|
95 | - ), |
|
96 | - 'edit'=> |
|
97 | - array( |
|
98 | - 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_OWNER,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
99 | - 'label'=>'LBL_ACTION_EDIT', |
|
100 | - 'default'=>ACL_ALLOW_ALL, |
|
90 | + 'list'=> |
|
91 | + array( |
|
92 | + 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_OWNER,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
93 | + 'label'=>'LBL_ACTION_LIST', |
|
94 | + 'default'=>ACL_ALLOW_ALL, |
|
95 | + ), |
|
96 | + 'edit'=> |
|
97 | + array( |
|
98 | + 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_OWNER,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
99 | + 'label'=>'LBL_ACTION_EDIT', |
|
100 | + 'default'=>ACL_ALLOW_ALL, |
|
101 | 101 | |
102 | - ), |
|
103 | - 'delete'=> |
|
104 | - array( |
|
105 | - 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_OWNER,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
106 | - 'label'=>'LBL_ACTION_DELETE', |
|
107 | - 'default'=>ACL_ALLOW_ALL, |
|
102 | + ), |
|
103 | + 'delete'=> |
|
104 | + array( |
|
105 | + 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_OWNER,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
106 | + 'label'=>'LBL_ACTION_DELETE', |
|
107 | + 'default'=>ACL_ALLOW_ALL, |
|
108 | 108 | |
109 | - ), |
|
110 | - 'import'=> |
|
111 | - array( |
|
112 | - 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
113 | - 'label'=>'LBL_ACTION_IMPORT', |
|
114 | - 'default'=>ACL_ALLOW_ALL, |
|
115 | - ), |
|
116 | - 'export'=> |
|
117 | - array( |
|
118 | - 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_OWNER,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
119 | - 'label'=>'LBL_ACTION_EXPORT', |
|
120 | - 'default'=>ACL_ALLOW_ALL, |
|
121 | - ), |
|
109 | + ), |
|
110 | + 'import'=> |
|
111 | + array( |
|
112 | + 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
113 | + 'label'=>'LBL_ACTION_IMPORT', |
|
114 | + 'default'=>ACL_ALLOW_ALL, |
|
115 | + ), |
|
116 | + 'export'=> |
|
117 | + array( |
|
118 | + 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_OWNER,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
119 | + 'label'=>'LBL_ACTION_EXPORT', |
|
120 | + 'default'=>ACL_ALLOW_ALL, |
|
121 | + ), |
|
122 | 122 | 'massupdate'=> |
123 | - array( |
|
124 | - 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
125 | - 'label'=>'LBL_ACTION_MASSUPDATE', |
|
126 | - 'default'=>ACL_ALLOW_ALL, |
|
127 | - ), |
|
123 | + array( |
|
124 | + 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
125 | + 'label'=>'LBL_ACTION_MASSUPDATE', |
|
126 | + 'default'=>ACL_ALLOW_ALL, |
|
127 | + ), |
|
128 | 128 | |
129 | 129 | |
130 | - ),), |
|
130 | + ),), |
|
131 | 131 | ); |
132 | 132 | |
133 | 133 |
@@ -44,8 +44,8 @@ |
||
44 | 44 | global $app_strings, $current_language; |
45 | 45 | |
46 | 46 | $dashletMeta['MyPipelineBySalesStageDashlet'] = array('title' => 'LBL_TITLE', |
47 | - 'description' => 'LBL_TITLE', |
|
48 | - 'icon' => 'icon_Charts_Funnel_32.gif', |
|
49 | - 'module' => 'Opportunities', |
|
50 | - 'category' => 'Charts'); |
|
47 | + 'description' => 'LBL_TITLE', |
|
48 | + 'icon' => 'icon_Charts_Funnel_32.gif', |
|
49 | + 'module' => 'Opportunities', |
|
50 | + 'category' => 'Charts'); |
|
51 | 51 | ?> |
@@ -43,6 +43,6 @@ |
||
43 | 43 | |
44 | 44 | |
45 | 45 | $dashletStrings['MyPipelineBySalesStageDashlet'] = array('LBL_TITLE' => 'My Pipeline By Sales Stage', |
46 | - 'LBL_DESCRIPTION' => 'Vertical Bar Chart of My Sales Stage Pipeline', |
|
47 | - 'LBL_REFRESH' => 'Refresh Chart'); |
|
46 | + 'LBL_DESCRIPTION' => 'Vertical Bar Chart of My Sales Stage Pipeline', |
|
47 | + 'LBL_REFRESH' => 'Refresh Chart'); |
|
48 | 48 | ?> |
49 | 49 | \ No newline at end of file |
@@ -43,6 +43,6 @@ |
||
43 | 43 | |
44 | 44 | |
45 | 45 | $dashletStrings['OutcomeByMonthDashlet'] = array('LBL_TITLE' => 'Outcome by Month', |
46 | - 'LBL_DESCRIPTION' => 'Chart of the Monthly Outcomes', |
|
47 | - 'LBL_REFRESH' => 'Refresh Chart'); |
|
46 | + 'LBL_DESCRIPTION' => 'Chart of the Monthly Outcomes', |
|
47 | + 'LBL_REFRESH' => 'Refresh Chart'); |
|
48 | 48 | ?> |
49 | 49 | \ No newline at end of file |