Results 1 to 2 of 2

Thread: Adding New Actions to Roles (How I did it)

  1. #1
    mrbarletta is offline Junior Member
    Join Date
    Jun 2009
    Posts
    6

    Thumbs up Adding New Actions to Roles (How I did it)

    Hi there,

    I needed to manage a new kind of Permission to Sugarcrm CE 6.2.X . Out of the box you have, VIEW/LIST/ACCESS/IMPORT/EXPORT/DELETE and I wanted to manage a new Optionn called "Massupdate" and other stuff, so I added a new Action called massupdate and now I can manage it from the "Roles" section.

    This is how I did it:

    1. Define de new action in modules/ACLActions/actiondefs.php
    2. Repair Roles
    3. Use it in your code
    4. set language


    1) modules/ACLActions/actiondefs.php
    Code:
    'massupdate'=>
    	array(
    	'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_OWNER,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE),
    	'label'=>'LBL_ACTION_MASSUPDATE',
    	'default'=>ACL_ALLOW_ALL,
    	),
    2) Repair Roles

    3) Use in the code

    Code:
    if (ACLController::checkAccess('Opportunities', 'massupdate')) {
    				 //your magic here :)
    			}
    You can use this type of permission verification for:
    1. Enabling/Disabling mass update option for a defined Role
    2. Show different views to different roles - overloading the view.list.php
    3. ...etc.etc.etc


    4) you shall now

    Hope it helps someone else out there!

  2. #2
    bhaskarpal is offline Junior Member
    Join Date
    Dec 2011
    Posts
    3

    Default Re: Adding New Actions to Roles (How I did it)

    Hi,
    I need to do something quite opposite i.e restrict privileges through roles.

    By default as soon as a new user is created, he is provided full privileges to all modules whereas I'd want him/her to have some very minimum privileges unless specifically assigned through adding to any role.

    Can you help me where and what changes need to be done since general user role doesn't show up for editing anywhere.

    Sugar version 6.1 community edition.

    Thanks
    Bhaskar

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 2012-02-14, 09:05 AM
  2. Actions based on Roles
    By esbeto in forum Developer Help
    Replies: 0
    Last Post: 2009-11-20, 04:36 AM
  3. Adding actions to service custom module
    By PorthosLohnes in forum Developer Help
    Replies: 1
    Last Post: 2009-06-10, 04:12 AM
  4. Replies: 0
    Last Post: 2007-11-12, 01:13 AM
  5. Roles-Contacts and Roles-Accounts
    By jmontani in forum Developer Help
    Replies: 0
    Last Post: 2005-07-20, 08:35 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •