Since logic hooks are not available for subpanel records, is there a possibility for checking role permissions and allow or disallow removing record from subpanel?
SugarCRM 5.1 or 5.2
Thanks,
Igor
Since logic hooks are not available for subpanel records, is there a possibility for checking role permissions and allow or disallow removing record from subpanel?
SugarCRM 5.1 or 5.2
Thanks,
Igor
The process_record logic hook fires for EVERY record displayed on a subpanel.
You can also add code to the bottom of the subpanel file (modules/<module>metadata/subpanels/default.php) to check the role permissions and unset the remove/edit button part of the definition if needed.
ie:
PHP Code:global $current_user;
if (!is_admin($current_user))
{
$subpanel_layout['top_buttons'] = array();
unset ($subpanel_layout['list_fields']['remove_button']);
}
--
Marnus van Niekerk
There are only 10 types of people in the world
those who can read binary and those who don't
Modules:
CE Teams - Upgrade safe teams module for Community Edition
FieldACL - Field Level Access Control for Community Edition
EditLogicHooks - Create and edit Logic Hooks from the Admin GUI
FlexibleChartDashlet - Display any data in a Dashlet Chart
DocumentThumbnails - Thumbnails for Documents module
Many questions can be answered by reading the Developers Manual
This looks fine.
What I need is a check for the role membership. Is there a similar function for checking the role membership?
Thanks,
Igor
Have a look at the ACLController::checkAccess function in modules/ACL/ACLController.php or you can just run a query on the table acl_roles_users.
--
Marnus van Niekerk
There are only 10 types of people in the world
those who can read binary and those who don't
Modules:
CE Teams - Upgrade safe teams module for Community Edition
FieldACL - Field Level Access Control for Community Edition
EditLogicHooks - Create and edit Logic Hooks from the Admin GUI
FlexibleChartDashlet - Display any data in a Dashlet Chart
DocumentThumbnails - Thumbnails for Documents module
Many questions can be answered by reading the Developers Manual
Thanks a lot.
I manage to achieve with this:
if (!ACLController::checkAccess(my_module_folder_name , edit, false, 'module')) {
$subpanel_layout['top_buttons'] = array();
unset ($subpanel_layout['list_fields']['edit_button']);
}
I was looking for this feature a long time ago. I will put this in the tutorial forum.
Thanks again,
Igor
Last edited by Azmir; 2009-05-04 at 06:46 PM.
Hello,
I've got a problem. When I unset the buttons, remove- and edit option I can already see the the select-button and the remove option. Anyone an idea why?
This is my array:
Array
(
[top_buttons] => Array
(
)
[where] =>
[list_fields] => Array
(
.
.
.
[phone_office] => Array
(
[vname] => LBL_LIST_PHONE
[width] => 20%
)
)
)
thanks for reply
Jan
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks