Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Corné Aussems
[RESOLVED] permissionChecker.isCompanyAdmin in velocity not found LR 442
April 3, 2008 10:11 AM
Answer

Corné Aussems

Rank: Liferay Legend

Posts: 1181

Join Date: October 3, 2006

Recent Posts

I was happy to see the possibilty in $permissionChecker for the other admin types

$permissionChecker.isOmniadmin() works like oldtimes
but helaas;
$permissionChecker.isCompanyAdmin()
$permissionChecker.isCommunityAdmin()
$permissionChecker.isCommunityOwner()

don't?

Do I miss out on something or have somewhere an old PermissionChecker in classpath?

1
2
3package com.liferay.portal.theme;
4public class ThemeDisplay implements Serializable {
5    public PermissionChecker getPermissionChecker() {
6        return _permissionChecker;
7    }

 1
 2package com.liferay.portal.kernel.security.permission;
 3public interface PermissionChecker {
 4
 5    public long getUserId();
 6
 7    public boolean hasPermission(
 8        long groupId, String name, long primKey, String actionId);
 9
10    public boolean hasPermission(
11        long groupId, String name, String primKey, String actionId);
12
13    public boolean hasUserPermission(
14        long groupId, String name, String primKey, String actionId,
15        boolean checkAdmin);
16
17    public boolean isOmniadmin();
18
19    public boolean isCompanyAdmin(long companyId);
20
21    public boolean isCommunityAdmin(long groupId);
22
23    public boolean isCommunityOwner(long groupId);
24
25}
Marco Puhlmann
RE: permissionChecker.isCompanyAdmin in velocity not found LR 442
April 3, 2008 7:30 AM
Answer

Marco Puhlmann

Rank: New Member

Posts: 18

Join Date: January 9, 2006

Recent Posts

Hi Corné,

as you can see in the method signatures, you have to call the last three with a parameter of type long.

Example:

If you want to check if the user is the company admin, try this:

1$permissionChecker.isCompanyAdmin($company_id)


best regards,

M.Puhlmann
Corné Aussems
RE: permissionChecker.isCompanyAdmin in velocity not found LR 442
April 3, 2008 7:35 AM
Answer

Corné Aussems

Rank: Liferay Legend

Posts: 1181

Join Date: October 3, 2006

Recent Posts

I can not describe how stupid i feel emoticon

thanks