Forums de discussion

Programmatic permissions on all users with org. role for specific orgs.

Martin Straus, modifié il y a 11 années.

Programmatic permissions on all users with org. role for specific orgs.

New Member Publications: 19 Date d'inscription: 06/07/12 Publications récentes
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, modifié il y a 11 années.

RE: Programmatic permissions on all users with org. role for specific orgs.

New Member Publications: 19 Date d'inscription: 06/07/12 Publications récentes
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.