Leveraging ACL access levels in your code: Part 2 – Record Level ACLs and some more Module Level ACLs

sugarcrmdevelopers —  October 4, 2012 — 1 Comment

Yesterday the conversation was around determining the module level ACL permissions, more specifically determining if the User object has Administrator or Developer privileges for the module. Today, we’ll drop down a level and look at how to determine if a user has permission at the record level, and also look at  various other permission that can be set.

There’s a nice API for reading into this, using the SugarBean::ACLAccess($view) method call. For the $view parameter, you can pass in one of several options, as illustrated below…

You’ll notice the options are broken into two parts…

  • A set of ACLs pertaining to the record itself ( view, edit, delete, export ). These also leverage the record owner to determine if the current User object has access to do that action
  • A set of ACLs around the module itself ( list, export, massupdate ).

Once again, these can be used anywhere in the app ( including Smarty templates ) and can be easily used to figure out if the user has access to a record or not, or whether certain module actions can be performed by the user or not.

Tomorrow, we will dig one level deeper, and look at how in the commercial editions you can leverage ACLs at the field level as well.

Trackbacks and Pingbacks:

  1. SugarCRM Developer Blog » Blog Archive » Leveraging ACL access levels in your code: Part 3 – Field Level ACLs - October 5, 2012

    […] part 1 and part 2 of this series has focused on the module and record level ACL permissions for records. If you are a […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s