掲示板

Restricting Permission of Owner

thumbnail
11年前 に Jan Geißler によって更新されました。

Restricting Permission of Owner

Liferay Master 投稿: 735 参加年月日: 11/07/05 最新の投稿
Hi everybody.
First of all i am working with 6.1 ga1.
Hope sombody can help me out on this, as I am getting a little frustrated. I have the problem to disable the Permissions Button on the Calendar portlet for the Owner of a Site. The requirements states, that all Configuration and Setup has to available ONLY for the SuperAdmins of the portal. Nobody else should be able to access them. Here is what I did:
Wrote an Ext plugin where I overwrite the Permission in the resource-permission folder for all portlets. something like this (example from Calendar ;)

<resource-action-mapping>
	<portlet-resource>
		<portlet-name>8</portlet-name>
		<permissions>
			<supports>
				<action-key>ACCESS_IN_CONTROL_PANEL</action-key>
				<action-key>ADD_TO_PAGE</action-key>
				<action-key>CONFIGURATION</action-key>
				<action-key>VIEW</action-key>
			</supports>
			<site-member-defaults>
				<action-key>VIEW</action-key>
			</site-member-defaults>
			<guest-defaults>
				<action-key>VIEW</action-key>
			</guest-defaults>
			<guest-unsupported>
				<action-key>ACCESS_IN_CONTROL_PANEL</action-key>
				<action-key>CONFIGURATION</action-key>
			</guest-unsupported>
		</permissions>
	</portlet-resource>
	<model-resource>
		<model-name>com.liferay.portlet.calendar</model-name>
		<portlet-ref>
			<portlet-name>8</portlet-name>
		</portlet-ref>
		<permissions>
			<supports>
				<action-key>ADD_EVENT</action-key>
				<action-key>EXPORT_ALL_EVENTS</action-key>
				<action-key>PERMISSIONS</action-key>
			</supports>
			<site-member-defaults />
			<guest-defaults />
			<guest-unsupported>
				<action-key>ADD_EVENT</action-key>
				<action-key>PERMISSIONS</action-key>
			</guest-unsupported>
			<owner-defaults>
				<action-key>ADD_EVENT</action-key>
			</owner-defaults>
		</permissions>
	</model-resource>
....
...
</resource-action-mapping>

Checked the Database and Updated all existing entries whith the relevant ActionID's (bitwise values)
Result:
The Permissions Button is still there, but when a Owner clicks it, it shows a "You do not have the required permission to access this" Or something like that.
I tried checking the Liferay Code for the according code Snippet, but I didn't for the Life of me found it.
Every help would be really appreciated!

Thanx in advance!
Jan
thumbnail
11年前 に Jan Geißler によって更新されました。

RE: Restricting Permission of Owner

Liferay Master 投稿: 735 参加年月日: 11/07/05 最新の投稿
....push.....
11年前 に Oliver Bayer によって更新されました。

RE: Restricting Permission of Owner

Liferay Master 投稿: 894 参加年月日: 09/02/18 最新の投稿
Hi Jan,

the easiest solution would be -even if it's a bit of a hack- to hide the configuration button if the current user is not the omniadmin.

Greets Oli
thumbnail
11年前 に Jan Geißler によって更新されました。

RE: Restricting Permission of Owner

Liferay Master 投稿: 735 参加年月日: 11/07/05 最新の投稿
You are right...
This is a "Hack" ;)
So not my prevered way of doing it, because you would disable the whole resource permission system at this point. In fact I want to utilize the permission system to achieve the expected behavior.
I also found this call in the EventIterator.jspf:

boolean showPermissionsButton = GroupPermissionUtil.contains(permissionChecker, scopeGroupId, ActionKeys.PERMISSIONS);

Which is in my Opinion somhow strange....
That would indicate I have to remove the permissions permission for a Site Owner, which isn't really straight forward, is it not?

But nevertheless, thanks for your input ;)

So long
Jan