com.dotmarketing.business
Class PermissionFactoryImpl

java.lang.Object
  extended by com.dotmarketing.business.PermissionFactory
      extended by com.dotmarketing.business.PermissionFactoryImpl

public class PermissionFactoryImpl
extends PermissionFactory

Author:
maria & david (2005), Carlos Rivas (2007)

Constructor Summary
PermissionFactoryImpl(PermissionCache permissionCache)
           
 
Method Summary
protected  void deletePermission(Permission p)
          Deletes the permission from db
protected  Permission getPermission(java.lang.String x)
          This method returns the permission by id
protected
<P extends Permissionable>
java.util.Map<Permissionable,java.util.List<Permission>>
getPermissions(java.util.List<P> permissionables)
           
protected  java.util.List<Permission> getPermissions(Permissionable permissionable)
          This method returns a list of all the permission the object have associated
protected  java.util.List<Permission> getPermissionsFromCache(Permissionable permissionable)
          This method returns a list of all the permission the object have associated from the cache.
protected  int getUserCount(Permissionable permissionable, int permissionType, java.lang.String filter)
          Counts how many ocurrences of users that have the specified permission over the inode object.
protected  java.util.List<com.liferay.portal.model.User> getUsers(Permissionable permissionable, int permissionType, java.lang.String filter, int start, int limit)
          Gets a list of users that have the specified permission over the inode object
protected  java.util.Map<java.lang.String,java.lang.Object> getUsersAndRolesWithPermissionOnInode(java.lang.String filter, Permissionable permissionable, int permissionType, int start, int limit)
          Deprecated. 
protected  java.util.Map<java.lang.String,java.lang.Object> getUsersWithPermissionOnInode(java.lang.String filter, Permissionable permissionable, int permissionType, int start, int limit)
          Deprecated. 
protected  void savePermission(Permission p)
          This method saves or update the permission object in db
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PermissionFactoryImpl

public PermissionFactoryImpl(PermissionCache permissionCache)
Parameters:
permissionCache -
Method Detail

getPermission

protected Permission getPermission(java.lang.String x)
Description copied from class: PermissionFactory
This method returns the permission by id

Specified by:
getPermission in class PermissionFactory
Parameters:
x - permision id
Returns:
Permision

getPermissions

protected java.util.List<Permission> getPermissions(Permissionable permissionable)
Description copied from class: PermissionFactory
This method returns a list of all the permission the object have associated

Specified by:
getPermissions in class PermissionFactory
Returns:
List

deletePermission

protected void deletePermission(Permission p)
Description copied from class: PermissionFactory
Deletes the permission from db

Specified by:
deletePermission in class PermissionFactory
Parameters:
p - permission

savePermission

protected void savePermission(Permission p)
Description copied from class: PermissionFactory
This method saves or update the permission object in db

Specified by:
savePermission in class PermissionFactory
Parameters:
p - permission

getUsersAndRolesWithPermissionOnInode

@Deprecated
protected java.util.Map<java.lang.String,java.lang.Object> getUsersAndRolesWithPermissionOnInode(java.lang.String filter,
                                                                                                            Permissionable permissionable,
                                                                                                            int permissionType,
                                                                                                            int start,
                                                                                                            int limit)
Deprecated. 

Description copied from class: PermissionFactory
Gets a list of user and roles that have the specified permission over the inode object

Specified by:
getUsersAndRolesWithPermissionOnInode in class PermissionFactory
Parameters:
filter - compare string
permissionType - type of permission (READ, WRITE OR PUBLISH)
start - first element to show
limit - max number of element to show
Returns:
Map

getUsersWithPermissionOnInode

@Deprecated
protected java.util.Map<java.lang.String,java.lang.Object> getUsersWithPermissionOnInode(java.lang.String filter,
                                                                                                    Permissionable permissionable,
                                                                                                    int permissionType,
                                                                                                    int start,
                                                                                                    int limit)
Deprecated. 

Description copied from class: PermissionFactory
Gets a list of users that have the specified permission over the inode object

Specified by:
getUsersWithPermissionOnInode in class PermissionFactory
Parameters:
filter - compare string
permissionType - type of permission (READ, WRITE OR PUBLISH)
start - first element to show
limit - max number of element to show
Returns:
Map

getUsers

protected java.util.List<com.liferay.portal.model.User> getUsers(Permissionable permissionable,
                                                                 int permissionType,
                                                                 java.lang.String filter,
                                                                 int start,
                                                                 int limit)
Description copied from class: PermissionFactory
Gets a list of users that have the specified permission over the inode object

Specified by:
getUsers in class PermissionFactory
permissionType - type of permission (READ, WRITE OR PUBLISH)
filter - compare string
start - first element to show
limit - max number of element to show
Returns:
List

getUserCount

protected int getUserCount(Permissionable permissionable,
                           int permissionType,
                           java.lang.String filter)
Description copied from class: PermissionFactory
Counts how many ocurrences of users that have the specified permission over the inode object.

Specified by:
getUserCount in class PermissionFactory
permissionType - type of permission (READ, WRITE OR PUBLISH)
filter - compare string
Returns:
An integer indicating the number of users.

getPermissionsFromCache

protected java.util.List<Permission> getPermissionsFromCache(Permissionable permissionable)
Description copied from class: PermissionFactory
This method returns a list of all the permission the object have associated from the cache. This method will not goto the database. The result will be null if not in the cache

Specified by:
getPermissionsFromCache in class PermissionFactory
Parameters:
permissionable - The object from where we going to take the permissions
Returns:
List

getPermissions

protected <P extends Permissionable> java.util.Map<Permissionable,java.util.List<Permission>> getPermissions(java.util.List<P> permissionables)
                                                                           throws DotDataException,
                                                                                  DotSecurityException
Specified by:
getPermissions in class PermissionFactory
Throws:
DotDataException
DotSecurityException


Copyright © 2009 Dotmarketing, Inc. All Rights Reserved.