當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Permission::delete方法代碼示例

本文整理匯總了PHP中Permission::delete方法的典型用法代碼示例。如果您正苦於以下問題:PHP Permission::delete方法的具體用法?PHP Permission::delete怎麽用?PHP Permission::delete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Permission的用法示例。


在下文中一共展示了Permission::delete方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: disable

 function disable()
 {
     $permission = new Permission();
     $cc = new ConstraintChain();
     $cc->add(new Constraint('permission', '=', $this->name));
     $permission->loadBy($cc);
     if ($permission && $permission->delete()) {
         return $this->update($this->id, 'enabled', false);
     }
     return true;
 }
開發者ID:uzerpllp,項目名稱:uzerp,代碼行數:11,代碼來源:ModuleObject.php

示例2: procede

 public function procede()
 {
     try {
         if ($this->oRequest->existParam('m')) {
             if (!$this->oRequest->existParam('r')) {
                 throw new Error('FRAMEWORK_ERROR_ACCESS_UNKNOWN', 3);
             }
             $oPermission = new Permission($this->oRequest->getParam('m', 'int'), $this->oRequest->getParam('r', 'int'));
             if ($this->oRequest->getParam('v', 'boolean')) {
                 $oPermission->store();
             } else {
                 $oPermission->delete();
             }
             Logger::log('admin', Language::translate('PERMISSIONS_ADMIN_ACCESS_UPDATELOG') . '[' . $this->oCurrentUser->getLogin() . ']');
             $this->oView->addAlert(Language::translate('PERMISSIONS_ADMIN_ACCESS_UPDATE'), 'success');
         }
     } catch (Exception $ex) {
         $this->oView->addAlert($ex, 'danger');
     } finally {
         $this->createView();
     }
 }
開發者ID:Jatax,項目名稱:TKS,代碼行數:22,代碼來源:adminpermissions.controller.php

示例3: remove_permission

 /**
  * Remove Permission
  * Remove a permission from the database
  * 
  * @param mixed $permission
  */
 public function remove_permission($permission)
 {
     $p = new Permission();
     $p->get_by_permission($permission);
     if (!$p->exists()) {
         $p->delete();
     }
 }
開發者ID:Moro3,項目名稱:duc,代碼行數:14,代碼來源:Auth_simpleauth.php

示例4: delete

 public function delete()
 {
     // we're echoing JSON, so lets tell the browser
     // this is required for $.ajax to be able to intelligently guess what the dataType is
     header('Content-type: application/json');
     // get the id from data
     if (is_ajax()) {
         $id = !empty($this->_data['id']) ? $this->_data['id'] : $_id;
     }
     $permission = new Permission();
     // NOTE: the db will take care od cascading the delete to child rows
     if ($permission->delete($id)) {
         echo json_encode(array('success' => TRUE));
     } else {
         echo json_encode(array('success' => FALSE));
     }
     exit;
 }
開發者ID:uzerpllp,項目名稱:uzerp,代碼行數:18,代碼來源:PermissionsController.php

示例5: session_start

<?php

session_start();
include_once "../php/Permission.php";
if (isset($_POST['save'])) {
    $permission = new Permission();
    $permission->lockSerial($_POST['lock']);
    $permission->recipientIdentification($_POST['recipient']);
    $permission->startDateHour($_POST['startDateHour']);
    $permission->endDateHour($_POST['endDateHour']);
    echo "tt";
    $permission->insert();
} elseif (isset($_POST['update'])) {
    $permission = new Permission();
    $permission->lockSerial($_POST['lock']);
    $permission->recipientIdentification($_POST['recipient']);
    $permission->startDateHour($_POST['startDateHour']);
    $permission->endDateHour($_POST['endDateHour']);
    $permission->update();
} elseif (isset($_POST['delete'])) {
    Permission::delete($_POST['lock'], $_POST['recipient']);
}
header("location: showPermissions.php");
開發者ID:smartlockmed,項目名稱:smartlock,代碼行數:23,代碼來源:managePermissions.php

示例6: managePermission

 public function managePermission($action)
 {
     try {
         $user_name = fRequest::get('user_name');
         $permission_name = fRequest::get('permission_name');
         if ($action == 'Add') {
             if (User::can('add-permission')) {
                 $permission = new Permission();
                 $permission->setUserName($user_name);
                 $permission->setPermissionName($permission_name);
                 $permission->store();
                 fMessaging::create('success', 'Permission added successfully.');
             } else {
                 throw new fAuthorizationException('You are not allowed to add permissions.');
             }
         } else {
             if ($action == 'Remove') {
                 if (User::can('remove-permission')) {
                     $permission = new Permission(array('user_name' => $user_name, 'permission_name' => $permission_name));
                     $permission->delete();
                     fMessaging::create('success', 'Permission removed successfully.');
                 } else {
                     throw new fAuthorizationException('You are not allowed to remove permissions.');
                 }
             }
         }
     } catch (fException $e) {
         fMessaging::create('error', $e->getMessage());
     }
     fURL::redirect(Util::getReferer());
 }
開發者ID:daerduoCarey,項目名稱:oj,代碼行數:31,代碼來源:DashboardController.php


注:本文中的Permission::delete方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。