This is the API documentation for concrete5 version 5.6 and earlier. View Current API Documentation
 1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 
<?php defined('C5_EXECUTE') or die("Access Denied.");
class Concrete5_Controller_Dashboard_Blocks_Permissions extends DashboardBaseController {
    
    public function save() {
        if (Loader::helper('validation/token')->validate('save_permissions')) {
            
            $tp = new TaskPermission();
            if ($tp->canAccessTaskPermissions()) {
                $permissions = PermissionKey::getList('block_type');
                foreach($permissions as $pk) {
                    $paID = $_POST['pkID'][$pk->getPermissionKeyID()];
                    $pt = $pk->getPermissionAssignmentObject();
                    $pt->clearPermissionAssignment();
                    if ($paID > 0) {
                        $pa = PermissionAccess::getByID($paID, $pk);
                        if (is_object($pa)) {
                            $pt->assignPermissionAccess($pa);
                        }           
                    }       
                }
                $this->redirect('/dashboard/blocks/permissions', 'updated');
            }
            
        } else {
            $this->error->add(Loader::helper("validation/token")->getErrorMessage());
        }
        
    }
    
    public function updated() {
        $this->set('success', t('Permissions updated successfully.'));
    }

}