56 $this->PermitAccess =
get_package(
'permit::permit_access' ,
'last' , __FILE__ );
57 $this->PermitAlgorithms =
get_package(
'permit::permit_algorithms' ,
'last' , __FILE__ );
58 $this->Security =
get_package(
'security' ,
'last' , __FILE__ );
88 $Permit = $this->Security->get_gp(
'permit' ,
'command' );
89 $MasterType = $this->Security->get_gp(
'master_type' ,
'command' );
91 if( $this->Security->get_gp(
'ids' ,
'set' ) )
93 $MasterId = explode(
',' , $this->Security->get_gp(
'ids' ,
'string' ) );
97 $MasterId = array( $this->Security->get_gp(
'master_id' ,
'integer' ) );
100 $this->PermitAccess->set_group_for_object( $Permit , $MasterId , $MasterType );
102 catch( Exception $e )
130 $Permit = $this->Security->get_gp(
'permit' ,
'command' );
131 $MasterType = $this->Security->get_gp(
'master_type' ,
'command' );
133 if( $this->Security->get_gp(
'ids' ,
'set' ) )
135 $MasterId = explode(
',' , $this->Security->get_gp(
'ids' ,
'string' ) );
139 $MasterId = array( $this->Security->get_gp(
'master_id' ,
'integer' ) );
142 $this->PermitAccess->delete_group_for_object( $Permit , $MasterId , $MasterType );
144 catch( Exception $e )
172 $Permit = $this->Security->get_gp(
'permit' ,
'command' );
173 $MasterType = $this->Security->get_gp(
'master_type' ,
'command' );
175 if( $this->Security->get_gp(
'ids' ,
'set' ) )
177 $MasterId = explode(
',' , $this->Security->get_gp(
'ids' ,
'string' ) );
181 $MasterId = array( $this->Security->get_gp(
'master_id' ,
'integer' ) );
184 $this->PermitAccess->toggle_group_for_object( $Permit , $MasterId , $MasterType );
186 catch( Exception $e )
214 private function clear_groups_for_object( $MasterId , $MasterType )
218 $GroupList = $this->Security->get_gp(
'group_list' ,
'string' );
219 $GroupList = explode(
',' , $GroupList );
221 foreach( $GroupList as $i => $Title )
223 $GroupAccess->delete_group_for_object( $Title , $MasterId , $MasterType );
226 catch( Exception $e )
254 if( $this->Security->get_gp(
'group_name' ,
'set' ,
false ) &&
255 $this->PermitAlgorithms->object_has_permit(
false ,
'user' ,
'permit_manager' ) )
257 $GroupAccess =
get_package(
'permit::group_access' ,
'last' , __FILE__ );
259 $MasterId =
get_field( $Parameters ,
'master_id' );
260 $MasterType =
get_field( $Parameters ,
'master_type' );
262 $this->clear_groups_for_object( $MasterId , $MasterType );
264 $GroupName = $this->Security->get_gp(
'group_name' ,
'command' );
266 $GroupAccess->add_group_for_object( $GroupName , $MasterId , $MasterType );
269 catch( Exception $e )
299 $ContextSet->add_context( dirname( __FILE__ ).
'/conf/cfcx_set_group' );
301 $ContextSet->add_context( dirname( __FILE__ ).
'/conf/cfcx_delete_group' );
303 $ContextSet->add_context( dirname( __FILE__ ).
'/conf/cfcx_toggle_group' );
305 $ContextSet->execute( $Options , $this , __FILE__ );
307 catch( Exception $e )