Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Martin Straus
Programmatic permissions on all users with org. role for specific orgs.
February 6, 2013 1:35 PM
Answer

Martin Straus

Rank: New Member

Posts: 19

Join Date: July 6, 2012

Recent Posts

Hi, all! I'm fairly recent with Liferay and I'm struggling with something I need to do. I'd think it's simple, but I can't figure out how to do it. This is the scenario:
  • I have a number of organizations
  • I have three organization roles (user, administrator, owner)
  • Users will have one of those roles in the organization to which they belong.
For instance:
  • Org A
  • Org B
  • User 1 has role "owner" in "Org A".
  • User 2 has role "user" in "Org A".
  • User 3 has role "user" in "Org B".
Thus far, nothing strange. All this can be configured with the standard Liferay portlets.

I'm creating a portlet which will enable users to create a new kind of resource. Another portlet will let users query those resources. When creating an instance of this resource, the user must be able to indicate which roles of each organization will have access to the resource. For instance: all users with role "owner" in either "Org A" or "Org B" can access "Resurce 1".
Martin Straus
RE: Programmatic permissions on all users with org. role for specific orgs.
February 6, 2013 1:34 PM
Answer

Martin Straus

Rank: New Member

Posts: 19

Join Date: July 6, 2012

Recent Posts

OK, I figured out how to do this. I created a new Resources for each organization, and then I created the ResourcesPermissions on each Resuorces for the organization roles. I can then use the PermissionChecker API to query whether a user has permissions on the resources.