当前位置: 首页>>代码示例>>PHP>>正文


PHP Project::revokeUser方法代码示例

本文整理汇总了PHP中Model\Project::revokeUser方法的典型用法代码示例。如果您正苦于以下问题:PHP Project::revokeUser方法的具体用法?PHP Project::revokeUser怎么用?PHP Project::revokeUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Model\Project的用法示例。


在下文中一共展示了Project::revokeUser方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: function

});
$server->register('updateColumn', function ($column_id, array $values) use($board) {
    return $board->updateColumn($column_id, $values);
});
$server->register('addColumn', function ($project_id, array $values) use($board) {
    $values += array('project_id' => $project_id);
    return $board->add($values);
});
$server->register('removeColumn', function ($column_id) use($board) {
    return $board->removeColumn($column_id);
});
$server->register('getAllowedUsers', function ($project_id) use($project) {
    return $project->getUsersList($project_id, false, false);
});
$server->register('revokeUser', function ($project_id, $user_id) use($project) {
    return $project->revokeUser($project_id, $user_id);
});
$server->register('allowUser', function ($project_id, $user_id) use($project) {
    return $project->allowUser($project_id, $user_id);
});
/**
 * Task procedures
 */
$server->register('createTask', function ($title, $project_id, $color_id = '', $column_id = 0, $owner_id = 0, $creator_id = 0, $date_due = '', $description = '', $category_id = 0, $score = 0) use($task) {
    $values = array('title' => $title, 'project_id' => $project_id, 'color_id' => $color_id, 'column_id' => $column_id, 'owner_id' => $owner_id, 'creator_id' => $creator_id, 'date_due' => $date_due, 'description' => $description, 'category_id' => $category_id, 'score' => $score);
    list($valid, ) = $task->validateCreation($values);
    return $valid && $task->create($values) !== false;
});
$server->register('getTask', function ($task_id) use($task) {
    return $task->getById($task_id);
});
开发者ID:Null-Kelvin,项目名称:kanboard,代码行数:31,代码来源:jsonrpc.php

示例2: testUsersList

 public function testUsersList()
 {
     $p = new Project($this->registry);
     $user = new User($this->registry);
     $user->create(array('username' => 'unittest', 'password' => 'unittest'));
     // We create project
     $this->assertEquals(1, $p->create(array('name' => 'UnitTest')));
     // No restriction, we should have everybody
     $this->assertEquals(array('Unassigned', 'admin', 'unittest'), $p->getUsersList(1));
     // We allow only the regular user
     $this->assertTrue($p->allowUser(1, 2));
     $this->assertEquals(array(0 => 'Unassigned', 2 => 'unittest'), $p->getUsersList(1));
     // We allow the admin user
     $this->assertTrue($p->allowUser(1, 1));
     $this->assertEquals(array(0 => 'Unassigned', 1 => 'admin', 2 => 'unittest'), $p->getUsersList(1));
     // We revoke only the regular user
     $this->assertTrue($p->revokeUser(1, 2));
     $this->assertEquals(array(0 => 'Unassigned', 1 => 'admin'), $p->getUsersList(1));
     // We revoke only the admin user, we should have everybody
     $this->assertTrue($p->revokeUser(1, 1));
     $this->assertEquals(array(0 => 'Unassigned', 1 => 'admin', 2 => 'unittest'), $p->getUsersList(1));
 }
开发者ID:Faldrian,项目名称:kanboard,代码行数:22,代码来源:ProjectTest.php


注:本文中的Model\Project::revokeUser方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。