*/
public static boolean canEditCurrentPortal(String remoteUser) {
if (remoteUser == null)
return false;
IdentityRegistry identityRegistry = Util.getUIPortalApplication().getApplicationComponent(IdentityRegistry.class);
Identity identity = identityRegistry.getIdentity(remoteUser);
if (identity == null)
return false;
UIPortal uiPortal = Util.getUIPortal();
// TODO this code only work for single edit permission
String editPermission = uiPortal.getEditPermission();
MembershipEntry membershipEntry = MembershipEntry.parse(editPermission);
return identity.isMemberOf(membershipEntry);
}