library/core/class.controller.php
public function Permission($Permission, $FullMatch = TRUE, $JunctionTable = '', $JunctionID = '') {
      $Session = Gdn::Session();

      if (!$Session->CheckPermission($Permission, $FullMatch, $JunctionTable, $JunctionID)) {
        if (!$Session->IsValid() && $this->DeliveryType() == DELIVERY_TYPE_ALL) {
           Redirect('/entry/signin?Target='.urlencode($this->SelfUrl));
        } else {
           Gdn::Dispatcher()->Dispatch('DefaultPermission');
           exit();
        }
      }
   }
public function Permission($Permission, $FullMatch = TRUE, $JunctionTable = '', $JunctionID = '') {
      $Session = Gdn::Session();

      if (!$Session->CheckPermission($Permission, $FullMatch, $JunctionTable, $JunctionID)) {
        if (!$Session->IsValid() && $this->DeliveryType() == DELIVERY_TYPE_ALL) {
           Redirect('/entry/signin?Target='.urlencode($this->SelfUrl));
        } else {
           Gdn::Dispatcher()->Dispatch('DefaultPermission');
           exit();
        }
      }
   }
public function Permission ( $ Permission , $ FullMatch = TRUE , $ JunctionTable = '' , $ JunctionID = '' ) { $ Session = Gdn :: Session ( ) ; if ( ! $ Session -> CheckPermission ( $ Permission , $ FullMatch , $ JunctionTable , $ JunctionID ) ) { if ( ! $ Session -> IsValid ( ) && $ this -> DeliveryType ( ) == DELIVERY_TYPE_ALL ) { Redirect ( '/entry/signin?Target=' . urlencode ( $ this -> SelfUrl ) ) ; } else { Gdn :: Dispatcher ( ) -> Dispatch ( 'DefaultPermission' ) ; exit ( ) ; } } }
Checks that the user has the specified permissions. If the user does not, they are redirected to the DefaultPermission route.
@param mixed $Permission A permission or array of permission names required to access this resource.
@param bool $FullMatch If $Permission is an array, $FullMatch indicates if all permissions specified are required. If false, the user only needs one of the specified permissions.
@param string $JunctionTable The name of the junction table for a junction permission.
@param in $JunctionID The ID of the junction permission.
Checks that the user has the specified permissions . If the user does not they are redirected to the DefaultPermission route .