Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

ezrole.php
Go to the documentation of this file.
1 <?php
34 class eZRole extends eZPersistentObject
35 {
36 public function __construct( $row = array() )
37 {
38 parent::__construct( $row );
39 $this->PolicyArray = 0;
40 $this->LimitIdentifier = false;
41 $this->LimitValue = false;
42 if ( isset( $row['limit_identifier'] ) )
43 $this->LimitIdentifier = $row['limit_identifier'];
44 if ( isset( $row['limit_value'] ) )
45 $this->LimitValue = $row['limit_value'];
46 if ( isset( $row['user_role_id'] ) )
47 $this->UserRoleID = $row['user_role_id'];
48 }
49
50 static function definition()
51 {
52 static $definition = array( "fields" => array( "id" => array( 'name' => 'ID',
53 'datatype' => 'integer',
54 'default' => 0,
55 'required' => true ),
56 "version" => array( 'name' => "Version",
57 'datatype' => 'integer',
58 'default' => 0,
59 'required' => true ),
60 "name" => array( 'name' => "Name",
61 'datatype' => 'string',
62 'default' => '',
63 'required' => true ),
64 "is_new" => array( 'name' => "IsNew",
65 'datatype' => 'integer',
66 'default' => '0',
67 'required' => false ) ),
68 "function_attributes" => array( "policies" => "policyList",
69 'limit_identifier' => 'limitIdentifier',
70 'limit_value' => 'limitValue',
71 'user_role_id' => 'userRoleID' ),
72 "keys" => array( "id" ),
73 "increment_key" => "id",
74 "sort" => array( "id" => "asc" ),
75 "class_name" => "eZRole",
76 "name" => "ezrole" );
77 return $definition;
78 }
79
85 function limitIdentifier()
86 {
87 return $this->LimitIdentifier;
88 }
89
95 function limitValue()
96 {
97 return $this->LimitValue;
98 }
99
105 function userRoleID()
106 {
107 return $this->UserRoleID;
108 }
109
115 function copy()
116 {
117 $db = eZDB::instance();
118 $db->begin();
119
120 $newRole = eZRole::createNew();
121 $this->copyPolicies( $newRole->attribute( 'id' ) );
122 $newRole->setAttribute( 'name', ezpI18n::tr( 'kernel/role/edit', 'Copy of %rolename', null,
123 array( '%rolename' => $this->attribute( 'name' ) ) ) );
124 $newRole->store();
125 $db->commit();
126 return $newRole;
127 }
128
133 function createTemporaryVersion()
134 {
135 $db = eZDB::instance();
136 $db->begin();
137
138 $newRole = eZRole::createNew();
139 $this->copyPolicies( $newRole->attribute( 'id' ) );
140 $newRole->setAttribute( 'name', $this->attribute( 'name' ) );
141 $newRole->setAttribute( 'version', $this->attribute( 'id' ) );
142 $newRole->store();
143
144 $db->commit();
145 return $newRole;
146 }
147
154 static function createNew()
155 {
156 $role = new eZRole( array( 'name' => ezpI18n::tr( 'kernel/role/edit', 'New role' ),
157 'is_new' => 1 ) );
158 $role->store();
159 return $role;
160 }
161
167 static function create( $roleName, $version = 0 )
168 {
169 $row = array( 'id' => null,
170 'name' => $roleName,
171 'version' => 0 );
172 $role = new eZRole( $row );
173 return $role;
174 }
175
195 function appendPolicy( $module, $function, $limitations = array() )
196 {
197 $policy = eZPolicy::create( $this->ID, $module, $function );
198
199 $db = eZDB::instance();
200 $db->begin();
201 $policy->store();
202 if ( count( $limitations ) > 0 )
203 {
204 foreach ( $limitations as $limitationIdentifier => $limitationValues )
205 {
206 if ( !is_array( $limitationValues ) )
207 $limitationValues = array( $limitationValues );
208 $policy->appendLimitation( $limitationIdentifier, $limitationValues );
209 }
210 }
211 $db->commit();
212
213 if ( isset( $this->Policies ) )
214 {
215 $this->Policies[] = $policy;
216 }
217 return $policy;
218 }
219
225 function copyPolicies( $roleID )
226 {
227 $db = eZDB::instance();
228 $db->begin();
229 foreach ( $this->attribute( 'policies' ) as $policy )
230 {
231 $policy->copy( $roleID );
232 }
233 $db->commit();
234 }
235
244 function hasPolicy( $moduleName, $functionName = false )
245 {
246 $hasPolicy = false;
247 $policyList = $this->policyList();
248 if ( is_array( $policyList ) && count( $policyList ) > 0 )
249 {
250 $db = eZDB::instance();
251 $db->begin();
252
253 foreach( $policyList as $key => $policy )
254 {
255 if ( is_object( $policy ) )
256 {
257 if ( $policy->attribute( 'module_name' ) == $moduleName )
258 {
259 if ( ( $functionName === false ) || ( $policy->attribute( 'function_name' ) == $functionName ) )
260 {
261 $hasPolicy = true;
262 }
263 }
264 }
265 }
266
267 $db->commit();
268 }
269
270 return $hasPolicy;
271 }
272
277 function revertFromTemporaryVersion()
278 {
279 $temporaryVersion = eZRole::fetch( 0, $this->attribute( 'id' ) );
280 if ( $temporaryVersion === null )
281 return 0;
282 $this->removePolicies();
283 $this->setAttribute( 'name', $temporaryVersion->attribute( 'name') );
284 $this->setAttribute( 'is_new', 0 );
285
286 $db = eZDB::instance();
287 $db->begin();
288 $this->store();
289
290 $query = "UPDATE ezpolicy
291 SET role_id = " . $this->attribute( 'id' ) . "
292 WHERE role_id = " . $temporaryVersion->attribute( 'id' );
293 $db->query( $query );
294 $temporaryVersion->removePolicies( false );
295 $temporaryVersion->remove();
296 $db->commit();
297
298 // Expire role cache
299 $handler = eZExpiryHandler::instance();
300 $handler->setTimestamp( 'user-info-cache', time() );
301 $handler->setTimestamp( 'user-class-cache', time() );
302 $handler->store();
303 }
304
311 static function removeTemporary()
312 {
313 $temporaryRoles = eZRole::fetchList( true );
314
315 $db = eZDB::instance();
316 $db->begin();
317 foreach ( $temporaryRoles as $role )
318 {
319 $role->removeThis();
320 }
321 $db->commit();
322 }
323
328 static function removeRole( $roleID )
329 {
330 if ( !isset( $roleID ) )
331 {
332 return 0;
333 }
334 return eZRole::fetch( $roleID )->removeThis();
335 }
336
343 function removeThis()
344 {
345 $db = eZDB::instance();
346 $db->begin();
347 foreach ( $this->attribute( 'policies' ) as $policy )
348 {
349 $policy->removeThis();
350 }
351 $db->query( "DELETE FROM ezrole WHERE id='" . $db->escapeString( $this->attribute( 'id' ) ) . "'" );
352 $db->query( "DELETE FROM ezuser_role WHERE role_id = '" . $db->escapeString( $this->attribute( 'id' ) ) . "'" );
353 $db->commit();
354 }
355
362 function removePolicies( $fromDB = true )
363 {
364 $db = eZDB::instance();
365 $db->begin();
366 if ( $fromDB )
367 {
368 foreach ( $this->attribute( 'policies' ) as $policy )
369 {
370 $policy->removeThis();
371 }
372 }
373 $db->commit();
374 unset( $this->Policies );
375 }
376
385 function removePolicy( $moduleName, $functionName = false )
386 {
387 $policyList = $this->policyList();
388 if ( is_array( $policyList ) && count( $policyList ) > 0 )
389 {
390 $db = eZDB::instance();
391 $db->begin();
392
393 foreach( $policyList as $key => $policy )
394 {
395 if ( is_object( $policy ) )
396 {
397 if ( $policy->attribute( 'module_name' ) == $moduleName )
398 {
399 if ( ( $functionName === false ) || ( $policy->attribute( 'function_name' ) == $functionName ) )
400 {
401 $policy->removeThis();
402 unset( $this->Policies[$key] );
403 }
404 }
405 }
406 }
407
408 $db->commit();
409 }
410 }
411
418 static function cleanupByNode( $node )
419 {
420 // Clean up role assignments with limitations related to this object
421 $db = eZDB::instance();
422 $db->begin();
423 $pathString = $node->attribute( 'path_string' );
424 $nodeID = $node->attribute( 'node_id' );
425 $db->query( "DELETE FROM ezuser_role
426 WHERE limit_value LIKE '$pathString%' AND limit_identifier='Subtree'" );
427 // Clean up subtree limitations related to this object
428
429
430 $limitationsToFix = eZPolicyLimitation::findByType( 'SubTree', $node->attribute( 'path_string' ), true, true );
431
432 foreach( $limitationsToFix as $limitation )
433 {
434 $values = $limitation->attribute( 'values' );
435 $valueCount = count( $values );
436 if ( $valueCount > 0 )
437 {
438 foreach ( $values as $value )
439 {
440 if ( strpos( $value->attribute( 'value' ), $node->attribute( 'path_string' ) ) === 0 )
441 {
442 $value->remove();
443 $valueCount--;
444 }
445 }
446 }
447 if( $valueCount == 0 )
448 {
449 $policy = eZPolicy::fetch( $limitation->attribute( 'policy_id' ) );
450 if ( is_object ( $policy ) )
451 {
452 $policy->removeThis();
453 }
454 }
455 }
456
457 $limitationsToFixNode = eZPolicyLimitation::findByType( 'Node', $node->attribute( 'node_id' ) );
458
459 foreach( $limitationsToFixNode as $limitation )
460 {
461 $values = $limitation->attribute( 'values' );
462 $valueCount = count( $values );
463 if ( $valueCount > 0 )
464 {
465 foreach ( $values as $value )
466 {
467 if ( $value->attribute( 'value' ) == $node->attribute( 'node_id' ) )
468 {
469 $value->remove();
470 $valueCount--;
471 }
472 }
473 }
474 if( $valueCount == 0 )
475 {
476 $policy = eZPolicy::fetch( $limitation->attribute( 'policy_id' ) );
477 if ( is_object ( $policy ) )
478 {
479 $policy->removeThis();
480 }
481 }
482 }
483
484 eZRole::expireCache();
485
486 $db->commit();
487
488 }
489
500 static function fetchByUser( $idArray, $recursive = false )
501 {
502 if ( count( $idArray ) < 1 )
503 {
504 return array();
505 }
506
507 $db = eZDB::instance();
508
509 if ( !$recursive )
510 {
511 $groupINSQL = $db->generateSQLINStatement( $idArray, 'ezuser_role.contentobject_id', false, false, 'int' );
512 $query = "SELECT DISTINCT ezrole.id,
513 ezrole.name,
514 ezuser_role.limit_identifier,
515 ezuser_role.limit_value,
516 ezuser_role.id as user_role_id
517 FROM ezrole,
518 ezuser_role
519 WHERE $groupINSQL AND
520 ezuser_role.role_id = ezrole.id";
521 }
522 else
523 {
524 $userNodeIDArray = array();
525 foreach( $idArray as $id )
526 {
527 $nodeDefinition = eZContentObjectTreeNode::fetchByContentObjectID( $id );
528 foreach ( $nodeDefinition as $nodeDefinitionElement )
529 {
530 $userNodeIDArray = array_merge( $nodeDefinitionElement->attribute( 'path_array' ), $userNodeIDArray );
531 }
532 }
533
534 if ( count( $userNodeIDArray ) < 1 )
535 {
536 return array();
537 }
538
539 $roleTreeINSQL = $db->generateSQLINStatement( $userNodeIDArray, 'role_tree.node_id', false, false, 'int' );
540 $query = "SELECT DISTINCT ezrole.id,
541 ezrole.name,
542 ezuser_role.limit_identifier,
543 ezuser_role.limit_value,
544 ezuser_role.id as user_role_id
545 FROM ezrole,
546 ezuser_role,
547 ezcontentobject_tree role_tree
548 WHERE ezuser_role.contentobject_id = role_tree.contentobject_id AND
549 ezuser_role.role_id = ezrole.id AND
550 $roleTreeINSQL";
551 }
552
553 $roleArray = $db->arrayQuery( $query );
554
555 $roles = array();
556 foreach ( $roleArray as $roleRow )
557 {
558 $role = new eZRole( $roleRow );
559 $roles[] = $role;
560 }
561
562 return $roles;
563 }
564
568 static function expireCache()
569 {
570 $http = eZHTTPTool::instance();
571
572 $http->removeSessionVariable( 'CanInstantiateClassList' );
573 $http->removeSessionVariable( 'ClassesCachedForUser' );
574
575 // Expire user (role) cache
576 eZUser::cleanupCache();
577 }
578
587 static function accessArrayByUserID( $idArray, $recursive = false )
588 {
589 $roles = eZRole::fetchByUser( $idArray, $recursive );
590 $userLimitation = false;
591
592 $accessArray = array();
593 foreach ( array_keys ( $roles ) as $roleKey )
594 {
595 $accessArray = array_merge_recursive( $accessArray, $roles[$roleKey]->accessArray() );
596 if ( $roles[$roleKey]->attribute( 'limit_identifier' ) )
597 {
598 $userLimitation = true;
599 }
600 }
601
602 if ( $userLimitation )
603 {
604 foreach( $accessArray as $moduleKey => $functionList )
605 {
606 foreach( $functionList as $functionKey => $policyList )
607 {
608 foreach( $policyList as $policyKey => $limitationList )
609 {
610 if ( is_array( $limitationList ) )
611 {
612 foreach( $limitationList as $limitationKey => $limitKeyArray )
613 {
614 if ( is_array( $limitKeyArray ) )
615 {
616 $accessArray[$moduleKey][$functionKey][$policyKey][$limitationKey] = array_unique( $limitKeyArray );
617 }
618 }
619 }
620 }
621 }
622 }
623 }
624 return $accessArray;
625 }
626
630 function accessArray( $ignoreLimitIdentifier = false )
631 {
632 $accessArray = array();
633
634 $policies = $this->attribute( 'policies' );
635 foreach ( array_keys( $policies ) as $policyKey )
636 {
637 $accessArray = array_merge_recursive( $accessArray, $policies[$policyKey]->accessArray( $ignoreLimitIdentifier ) );
638 }
639
640 return $accessArray;
641 }
642
643 function policyList()
644 {
645 if ( !isset( $this->Policies ) )
646 {
647 $sorting = array( 'module_name' => 'asc', 'function_name' => 'asc' );
648 $policies = eZPersistentObject::fetchObjectList(
649 eZPolicy::definition(),
650 null,
651 array( 'role_id' => $this->attribute( 'id' ), 'original_id' => 0 ),
652 $sorting, null, true );
653
654 if ( $this->LimitIdentifier )
655 {
656 foreach ( array_keys( $policies ) as $policyKey )
657 {
658 $policies[$policyKey]->setAttribute( 'limit_identifier', 'User_' . $this->attribute( 'limit_identifier' ) );
659 $policies[$policyKey]->setAttribute( 'limit_value', $this->attribute( 'limit_value' ) );
660 $policies[$policyKey]->setAttribute( 'user_role_id', $this->attribute( 'user_role_id' ) );
661 }
662 }
663 $this->Policies = $policies;
664 }
665
666 return $this->Policies;
667 }
668
677 static function fetchIDListByUser( $idArray )
678 {
679 $db = eZDB::instance();
680
681 $groupINSQL = $db->generateSQLINStatement( $idArray, 'ezuser_role.contentobject_id', false, false, 'int' );
682 $query = "SELECT DISTINCT ezrole.id AS id
683 FROM ezrole,
684 ezuser_role
685 WHERE $groupINSQL AND
686 ezuser_role.role_id = ezrole.id ORDER BY ezrole.id";
687
688 $retArray = array();
689 foreach( $db->arrayQuery( $query ) as $resultSet )
690 {
691 $retArray[] = $resultSet['id'];
692 }
693 return $retArray;
694 }
695
702 function assignToUser( $userID, $limitIdent = '', $limitValue = '' )
703 {
704 $db = eZDB::instance();
705 $limitIdent = $db->escapeString( $limitIdent );
706 $limitValue = $db->escapeString( $limitValue );
707 $userID =(int) $userID;
708
709 // Who assign which role to whom should be logged.
710 $object = eZContentObject::fetch( $userID );
711 $objectName = $object ? $object->attribute( 'name' ) : 'null';
712
713 eZAudit::writeAudit( 'role-assign', array( 'Role ID' => $this->ID, 'Role name' => $this->attribute( 'name' ),
714 'Assign to content object ID' => $userID,
715 'Content object name' => $objectName,
716 'Comment' => 'Assigned the current role to user or user group identified by the id: eZRole::assignToUser()' ) );
717
718 switch( $limitIdent )
719 {
720 case 'subtree':
721 {
722 $node = eZContentObjectTreeNode::fetch( $limitValue, false, false );
723 if ( $node )
724 {
725 $limitIdent = 'Subtree';
726 $limitValue = $node['path_string'];
727 }
728 else
729 {
730 $limitValue = '';
731 $limitIdent = '';
732 }
733 } break;
734 case 'section':
735 {
736 $limitIdent = 'Section';
737 } break;
738 }
739
740 $roleID = (int)$this->ID;
741 $query = "SELECT * FROM ezuser_role WHERE role_id='$roleID' AND contentobject_id='$userID' AND limit_identifier='$limitIdent' AND limit_value='$limitValue'";
742
743 $rows = $db->arrayQuery( $query );
744 if ( count( $rows ) > 0 )
745 return false;
746
747 $db->begin();
748
749 $query = "INSERT INTO ezuser_role ( role_id, contentobject_id, limit_identifier, limit_value ) VALUES ( '$roleID', '$userID', '$limitIdent', '$limitValue' )";
750 $db->query( $query );
751
752 $db->commit();
753 return true;
754 }
755
759 function fetchUserID()
760 {
761 $db = eZDB::instance();
762 $roleID = (int)$this->ID;
763
764 $query = "SELECT contentobject_id FROM ezuser_role WHERE role_id='$roleID'";
765
766 return $db->arrayQuery( $query );
767 }
768
775 function removeUserAssignment( $userID )
776 {
777 $db = eZDB::instance();
778 $userID = (int)$userID;
779 $roleID = (int)$this->ID;
780 $query = "DELETE FROM ezuser_role WHERE role_id='$roleID' AND contentobject_id='$userID'";
781
782 $db->query( $query );
783 }
784
793 function removeUserAssignmentByID( $id )
794 {
795 // Remove the assignment.
796 $db = eZDB::instance();
797 $id =(int) $id;
798 $query = "DELETE FROM ezuser_role WHERE id='$id'";
799 $db->query( $query );
800 }
801
805 function fetchUserByRole( )
806 {
807 $db = eZDB::instance();
808 $roleID = (int)$this->ID;
809
810 $query = "SELECT
811 ezuser_role.contentobject_id as user_id,
812 ezuser_role.limit_value,
813 ezuser_role.limit_identifier,
814 ezuser_role.id
815 FROM
816 ezuser_role
817 WHERE
818 ezuser_role.role_id = '$roleID'";
819
820 $userRoleArray = $db->arrayQuery( $query );
821 $userRoles = array();
822 foreach ( $userRoleArray as $userRole )
823 {
824 $role = array();
825 $role['user_object'] = eZContentObject::fetch( $userRole['user_id'] );
826 $role['user_role_id'] = $userRole['id'];
827 $role['limit_ident'] = $userRole['limit_identifier'];
828 $role['limit_value'] = $userRole['limit_value'];
829
830 $userRoles[] = $role;
831 }
832 return $userRoles;
833 }
834
835 static function fetchRolesByLimitation( $limit_identifier, $limit_value )
836 {
837 $db = eZDB::instance();
838 $limit_identifier = $db->escapeString( $limit_identifier );
839 $limit_value = $db->escapeString( $limit_value );
840 $query = "SELECT DISTINCT
841 ezuser_role.role_id as role_id,
842 ezuser_role.contentobject_id as user_id
843 FROM
844 ezuser_role
845 WHERE
846 ezuser_role.limit_value = '$limit_value' AND
847 ezuser_role.limit_identifier = '$limit_identifier'";
848
849 $userRoleArray = $db->arrayQuery( $query );
850 $userRoles = array();
851 foreach ( $userRoleArray as $userRole )
852 {
853 $role = array();
854 $role['user'] = eZContentObject::fetch( $userRole['user_id'] );
855 $role['role'] = eZRole::fetch( $userRole['role_id'] );
856 $userRoles[] = $role;
857 }
858 return $userRoles;
859 }
860
866 static function fetch( $roleID, $version = 0 )
867 {
868 if ( $version != 0 )
869 {
870 return eZPersistentObject::fetchObject( eZRole::definition(),
871 null, array( 'version' => $version ), true );
872 }
873 return eZPersistentObject::fetchObject( eZRole::definition(),
874 null, array('id' => $roleID ), true );
875 }
876
881 static function fetchByName( $roleName, $version = 0 )
882 {
883 return eZPersistentObject::fetchObject( eZRole::definition(),
884 null, array( 'name' => $roleName,
885 'version' => $version ), true );
886 }
887
888 static function fetchList( $tempVersions = false )
889 {
890 if ( !$tempVersions )
891 {
892 return eZPersistentObject::fetchObjectList( eZRole::definition(),
893 null, array( 'version' => '0'), null,null,
894 true );
895 }
896 else
897 {
898 return eZPersistentObject::fetchObjectList( eZRole::definition(),
899 null, array( 'version' => array( '>', '0') ), null,null,
900 true);
901 }
902 }
903
904 static function fetchByOffset( $offset, $limit, $asObject = true, $ignoreTemp = false, $ignoreNew = true )
905 {
906
907 if ( $ignoreTemp && $ignoreNew )
908 $igTemp = array( 'version' => '0',
909 'is_new' => '0' );
910 elseif ( $ignoreTemp )
911 $igTemp = array( 'version' => '0' );
912 elseif ( $ignoreNew )
913 $igTemp = array( 'is_new' => '0' );
914 else
915 $igTemp = null;
916
917 return eZPersistentObject::fetchObjectList( eZRole::definition(),
918 null,
919 $igTemp,
920 array( 'name' => 'ASC' ),
921 array( 'offset' => $offset, 'length' => $limit ),
922 $asObject );
923 }
924
933 static function roleCount( $ignoreNew = true )
934 {
935 $conds = array( 'version' => 0 );
936 if ( $ignoreNew === true )
937 {
938 $conds['is_new'] = 0;
939 }
940 return eZPersistentObject::count( eZRole::definition(), $conds );
941 }
942
946 function turnOffCaching()
947 {
948 $this->CachePolicies = false;
949 }
950
954 function turnOnCaching()
955 {
956 $this->CachePolicies = true;
957 }
958
959
961 public $ID;
962 public $Name;
963 public $Modules;
964 public $Functions;
965 public $LimitValue;
966 public $LimitIdentifier;
967 public $UserRoleID;
968 public $PolicyArray;
969 public $Sets;
970 public $Policies;
971 public $AccessArray;
972 public $CachePolicies = true;
973 public $Version;
974 public $IsNew;
975 }
976
977 ?>
eZAudit\writeAudit
static writeAudit( $auditName, $auditAttributes=array())
Definition: ezaudit.php:51
eZContentObjectTreeNode\fetch
static fetch( $nodeID=false, $lang=false, $asObject=true, $conditions=false)
Definition: ezcontentobjecttreenode.php:3058
eZContentObjectTreeNode\fetchByContentObjectID
static fetchByContentObjectID( $contentObjectID, $asObject=true, $contentObjectVersion=false)
Definition: ezcontentobjecttreenode.php:2918
eZContentObject\fetch
static fetch( $id, $asObject=true)
Definition: ezcontentobject.php:885
eZDB\instance
static instance( $databaseImplementation=false, $databaseParameters=false, $forceNewInstance=false)
Definition: ezdb.php:117
eZHTTPTool\instance
static instance()
Definition: ezhttptool.php:189
eZPersistentObject
Definition: ezpersistentobject.php:33
eZPersistentObject\fetchObject
static fetchObject( $def, $field_filters, $conds, $asObject=true, $grouping=null, $custom_fields=null)
Definition: ezpersistentobject.php:213
eZPersistentObject\store
store( $fieldFilters=null)
Definition: ezpersistentobject.php:304
eZPersistentObject\setAttribute
setAttribute( $attr, $val)
Definition: ezpersistentobject.php:1374
eZPersistentObject\count
static count( $def, $conds=null, $field=null)
Definition: ezpersistentobject.php:187
eZPersistentObject\attribute
attribute( $attr, $noFunction=false)
Definition: ezpersistentobject.php:1329
eZPersistentObject\fetchObjectList
static fetchObjectList( $def, $field_filters=null, $conds=null, $sorts=null, $limit=null, $asObject=true, $grouping=false, $custom_fields=null, $custom_tables=null, $custom_conds=null)
Definition: ezpersistentobject.php:806
eZPolicyLimitation\findByType
static findByType( $type, $value, $asObject=true, $useLike=true)
Definition: ezpolicylimitation.php:351
eZPolicy\create
static create( $roleID, $module, $function)
Definition: ezpolicy.php:142
eZPolicy\fetch
static fetch( $policyID)
Definition: ezpolicy.php:377
eZPolicy\definition
static definition()
Definition: ezpolicy.php:26
eZRole
A container for policies in the permission system.
Definition: ezrole.php:35
eZRole\__construct
__construct( $row=array())
Definition: ezrole.php:36
eZRole\fetch
static fetch( $roleID, $version=0)
Definition: ezrole.php:866
eZRole\assignToUser
assignToUser( $userID, $limitIdent='', $limitValue='')
Definition: ezrole.php:702
eZRole\turnOnCaching
turnOnCaching()
Definition: ezrole.php:954
eZRole\$AccessArray
$AccessArray
Definition: ezrole.php:971
eZRole\$Version
$Version
Definition: ezrole.php:973
eZRole\createTemporaryVersion
createTemporaryVersion()
Definition: ezrole.php:133
eZRole\removePolicy
removePolicy( $moduleName, $functionName=false)
Definition: ezrole.php:385
eZRole\$UserRoleID
$UserRoleID
Definition: ezrole.php:967
eZRole\definition
static definition()
Definition: ezrole.php:50
eZRole\$Policies
$Policies
Definition: ezrole.php:970
eZRole\$PolicyArray
$PolicyArray
Definition: ezrole.php:968
eZRole\cleanupByNode
static cleanupByNode( $node)
Definition: ezrole.php:418
eZRole\expireCache
static expireCache()
Definition: ezrole.php:568
eZRole\$CachePolicies
$CachePolicies
Definition: ezrole.php:972
eZRole\copy
copy()
Definition: ezrole.php:115
eZRole\$Functions
$Functions
Definition: ezrole.php:964
eZRole\$ID
$ID
Definition: ezrole.php:961
eZRole\revertFromTemporaryVersion
revertFromTemporaryVersion()
Definition: ezrole.php:277
eZRole\limitIdentifier
limitIdentifier()
Definition: ezrole.php:85
eZRole\fetchRolesByLimitation
static fetchRolesByLimitation( $limit_identifier, $limit_value)
Definition: ezrole.php:835
eZRole\removePolicies
removePolicies( $fromDB=true)
Definition: ezrole.php:362
eZRole\limitValue
limitValue()
Definition: ezrole.php:95
eZRole\copyPolicies
copyPolicies( $roleID)
Definition: ezrole.php:225
eZRole\fetchUserID
fetchUserID()
Definition: ezrole.php:759
eZRole\accessArray
accessArray( $ignoreLimitIdentifier=false)
Definition: ezrole.php:630
eZRole\fetchByOffset
static fetchByOffset( $offset, $limit, $asObject=true, $ignoreTemp=false, $ignoreNew=true)
Definition: ezrole.php:904
eZRole\removeRole
static removeRole( $roleID)
Definition: ezrole.php:328
eZRole\create
static create( $roleName, $version=0)
Definition: ezrole.php:167
eZRole\fetchIDListByUser
static fetchIDListByUser( $idArray)
Definition: ezrole.php:677
eZRole\userRoleID
userRoleID()
Definition: ezrole.php:105
eZRole\removeTemporary
static removeTemporary()
Definition: ezrole.php:311
eZRole\hasPolicy
hasPolicy( $moduleName, $functionName=false)
Definition: ezrole.php:244
eZRole\roleCount
static roleCount( $ignoreNew=true)
Definition: ezrole.php:933
eZRole\removeUserAssignmentByID
removeUserAssignmentByID( $id)
Definition: ezrole.php:793
eZRole\createNew
static createNew()
Definition: ezrole.php:154
eZRole\fetchByUser
static fetchByUser( $idArray, $recursive=false)
Definition: ezrole.php:500
eZRole\appendPolicy
appendPolicy( $module, $function, $limitations=array())
Definition: ezrole.php:195
eZRole\turnOffCaching
turnOffCaching()
Definition: ezrole.php:946
eZRole\$IsNew
$IsNew
Definition: ezrole.php:974
eZRole\removeThis
removeThis()
Definition: ezrole.php:343
eZRole\fetchUserByRole
fetchUserByRole()
Definition: ezrole.php:805
eZRole\$Name
$Name
Definition: ezrole.php:962
eZRole\removeUserAssignment
removeUserAssignment( $userID)
Definition: ezrole.php:775
eZRole\$LimitIdentifier
$LimitIdentifier
Definition: ezrole.php:966
eZRole\accessArrayByUserID
static accessArrayByUserID( $idArray, $recursive=false)
Definition: ezrole.php:587
eZRole\$Modules
$Modules
Definition: ezrole.php:963
eZRole\fetchList
static fetchList( $tempVersions=false)
Definition: ezrole.php:888
eZRole\$LimitValue
$LimitValue
Definition: ezrole.php:965
eZRole\$Sets
$Sets
Definition: ezrole.php:969
eZRole\fetchByName
static fetchByName( $roleName, $version=0)
Definition: ezrole.php:881
eZRole\policyList
policyList()
Definition: ezrole.php:643
eZUser\cleanupCache
static cleanupCache()
Definition: ezuser.php:2767
ezpI18n\tr
static tr( $context, $source, $comment=null, $arguments=null)
Definition: ezpi18n.php:86
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.