59 $this->CachedMultyFS =
get_package(
'cached_multy_fs' ,
'last' , __FILE__ );
60 $this->GroupAccess =
get_package(
'permit::group_access' ,
'last' , __FILE__ );
61 $this->Link =
get_package(
'link' ,
'last' , __FILE__ );
62 $this->PermitAccess =
get_package(
'permit::permit_access' ,
'last' , __FILE__ );
63 $this->PermitAlgorithms =
get_package(
'permit::permit_algorithms' ,
'last' , __FILE__ );
64 $this->Security =
get_package(
'security' ,
'last' , __FILE__ );
94 $Group = $this->GroupAccess->get_group_by_id( $this->Security->get_p(
'record_id' ,
'integer' ) );
95 $Permits = $this->Security->get_p(
'permits' ,
'command' , array() );
97 $HasPermits = $this->PermitAlgorithms->get_permits_for_object( $Group->id ,
'group' ,
false );
99 foreach( $HasPermits as $p )
101 if(
in_array( $p , $Permits ) ===
false )
103 $p = $this->PermitAccess->get_permit_by_name( $p );
104 $this->Link->delete_link( $Group->id , $p->id ,
'group' ,
'permit' );
108 foreach( $Permits as $p )
110 $this->PermitAccess->add_permit_for_object( $p , $Group->id ,
'group' );
113 catch( Exception $e )
141 $Group = $this->GroupAccess->get_group_by_id( $this->Security->get_p(
'group_record_id' ,
'integer' ) );
143 $this->Output = $this->CachedMultyFS->get_template( __FILE__ ,
'group_permits_view.tpl' );
145 $this->Output = str_replace(
'{path}' , dirname( __FILE__ ) , $this->Output );
146 $this->Output = str_replace(
'{title}' ,
get_field( $Group ,
'title' ) , $this->Output );
148 catch( Exception $e )
178 $ContextSet->add_context( dirname( __FILE__ ).
'/conf/cfcx_change_permits_controller' );
179 $ContextSet->execute( $Options , $this , __FILE__ );
181 catch( Exception $e )
215 $ContextSet->add_context( dirname( __FILE__ ).
'/conf/cfcx_change_permits_view' );
217 $ContextSet->execute( $Options , $this , __FILE__ );
219 return( $this->Output );
221 catch( Exception $e )