Foren

Home » Liferay Portal » English » 3. Development

Kombinierte Ansicht Flache Ansicht Baumansicht
Threads [ Zurück | Nächste ]
toggle
Martin Straus
Programmatic permissions on all users with org. role for specific orgs.
6. Februar 2013 13:35
Antwort

Martin Straus

Rang: New Member

Nachrichten: 19

Eintrittsdatum: 6. Juli 2012

Neue Beiträge

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.
6. Februar 2013 13:34
Antwort

Martin Straus

Rang: New Member

Nachrichten: 19

Eintrittsdatum: 6. Juli 2012

Neue Beiträge

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.