当前位置: 首页>>代码示例>>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;未经允许,请勿转载。