@@ -192,8 +192,8 @@ app.factory('BoardService', function(ApiService, $http, $q){
|
|||||||
return this.getCurrent().permissions['PERMISSION_EDIT'];
|
return this.getCurrent().permissions['PERMISSION_EDIT'];
|
||||||
};
|
};
|
||||||
|
|
||||||
BoardService.prototype.canManage = function(board = null) {
|
BoardService.prototype.canManage = function(board) {
|
||||||
if(board !== null) {
|
if(board !== null && board !== undefined) {
|
||||||
return board.permissions['PERMISSION_MANAGE'];
|
return board.permissions['PERMISSION_MANAGE'];
|
||||||
}
|
}
|
||||||
if(!this.getCurrent() || !this.getCurrent().permissions) {
|
if(!this.getCurrent() || !this.getCurrent().permissions) {
|
||||||
|
|||||||
@@ -87,6 +87,13 @@ class BoardService {
|
|||||||
$this->boardMapper->mapAcl($acl);
|
$this->boardMapper->mapAcl($acl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$permissions = $this->permissionService->matchPermissions($board);
|
||||||
|
$board->setPermissions([
|
||||||
|
'PERMISSION_READ' => $permissions[Acl::PERMISSION_READ],
|
||||||
|
'PERMISSION_EDIT' => $permissions[Acl::PERMISSION_EDIT],
|
||||||
|
'PERMISSION_MANAGE' => $permissions[Acl::PERMISSION_MANAGE],
|
||||||
|
'PERMISSION_SHARE' => $permissions[Acl::PERMISSION_SHARE]
|
||||||
|
]);
|
||||||
return $board;
|
return $board;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -65,9 +65,6 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="card-assignees" ng-if="c.assignees">
|
|
||||||
<!-- <div class="avatar" avatar user="{{c.owner}}" size="24"></div>//-->
|
|
||||||
</div>
|
|
||||||
<div class="card-controls">
|
<div class="card-controls">
|
||||||
<i class="icon icon-filetype-text" ng-if="c.description" title="{{ c.description }}"></i>
|
<i class="icon icon-filetype-text" ng-if="c.description" title="{{ c.description }}"></i>
|
||||||
<div class="app-popover-menu-utils" ng-if="!boardservice.isArchived>
|
<div class="app-popover-menu-utils" ng-if="!boardservice.isArchived>
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
<h2>{{ boardservice.getCurrent().title }}</h2>
|
<h2>{{ boardservice.getCurrent().title }}</h2>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{{board=boardservice.getCurrent();""}}
|
||||||
|
|
||||||
<ul class="tabHeaders">
|
<ul class="tabHeaders">
|
||||||
<li class="tabHeader" ng-class="{'selected': (status.boardtab==0 || !status.boardtab)}" ng-click="status.boardtab=0"><a><?php p($l->t('Sharing')); ?></a></li>
|
<li class="tabHeader" ng-class="{'selected': (status.boardtab==0 || !status.boardtab)}" ng-click="status.boardtab=0"><a><?php p($l->t('Sharing')); ?></a></li>
|
||||||
@@ -90,7 +91,7 @@
|
|||||||
<input type="text" class="input-inline" ng-model="newLabel.title" style="color:{{ newLabel.color|textColorFilter }};" autofocus-on-insert maxlength="100" />
|
<input type="text" class="input-inline" ng-model="newLabel.title" style="color:{{ newLabel.color|textColorFilter }};" autofocus-on-insert maxlength="100" />
|
||||||
</span>
|
</span>
|
||||||
<div class="colorselect">
|
<div class="colorselect">
|
||||||
<div class="color" ng-repeat="c in defaultColors" style="background-color:#{{ c }};" ng-click="newLabel.color=c" ng-class="{'selected': (c == newLabel.color) }"><br /></div>
|
<div class="color" ng-repeat="c in defaultColors" style="background-color:#{{ c }};" ng-click="newLabel.color=c" ng-class="{'selected': (c == newLabel.color), 'dark': (newBoard.color | textColorFilter) === '#ffffff' }"><br /></div>
|
||||||
</div>
|
</div>
|
||||||
<a ng-click="labelCreate(newLabel)" class="icon"><i class="icon icon-checkmark" ></i></a>
|
<a ng-click="labelCreate(newLabel)" class="icon"><i class="icon icon-checkmark" ></i></a>
|
||||||
<a ng-click="status.createLabel=false" class="icon icon-close"></a>
|
<a ng-click="status.createLabel=false" class="icon icon-close"></a>
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
<span class="board-bullet"
|
<span class="board-bullet"
|
||||||
style="background-color:#{{b.color}};"> </span>
|
style="background-color:#{{b.color}};"> </span>
|
||||||
</td>
|
</td>
|
||||||
<td ng-click="gotoBoard(b)">{{ b.title }}</td>
|
<td ng-click="gotoBoard(b)">{{ b.title }}</a></td>
|
||||||
<td>
|
<td>
|
||||||
<div id="assigned-users">
|
<div id="assigned-users">
|
||||||
<div class="avatardiv" avatar displayname="{{ b.owner.uid }}" title="{{ b.owner.displayname }}"></div>
|
<div class="avatardiv" avatar displayname="{{ b.owner.uid }}" title="{{ b.owner.displayname }}"></div>
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div class="hint"></div>
|
<div class="hint"></div>
|
||||||
<div class="app-popover-menu-utils" ng-if="b.archived && b.deletedAt == 0">
|
<div class="app-popover-menu-utils" ng-if="b.deletedAt == 0">
|
||||||
<button class="icon icon-more" title="More actions"></button>
|
<button class="icon icon-more" title="More actions"></button>
|
||||||
<div class="popovermenu bubble hidden">
|
<div class="popovermenu bubble hidden">
|
||||||
<ul>
|
<ul>
|
||||||
@@ -60,6 +60,7 @@
|
|||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr ng-if="status.filter === '' && status.addBoard">
|
<tr ng-if="status.filter === '' && status.addBoard">
|
||||||
<td><span class="icon icon-add"></span></td>
|
<td><span class="icon icon-add"></span></td>
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
<input id="newTitle" class="edit ng-valid ng-empty" type="text" placeholder="<?php p($l->t('New board title')); ?>" autofocus-on-insert ng-model="newBoard.title" maxlength="100">
|
<input id="newTitle" class="edit ng-valid ng-empty" type="text" placeholder="<?php p($l->t('New board title')); ?>" autofocus-on-insert ng-model="newBoard.title" maxlength="100">
|
||||||
<input type="submit" value="" class="action icon-checkmark svg">
|
<input type="submit" value="" class="action icon-checkmark svg">
|
||||||
<div class="colorselect">
|
<div class="colorselect">
|
||||||
<div class="color" ng-repeat="c in colors" style="background-color:#{{ c }};" ng-click="selectColor(c)" ng-class="{'selected': (c == newBoard.color) }"><br /></div>
|
<div class="color" ng-repeat="c in colors" style="background-color:#{{ c }};" ng-click="selectColor(c)" ng-class="{'selected': (c == newBoard.color)', dark': (newBoard.color | textColorFilter) === '#ffffff' }"><br /></div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -21,6 +21,8 @@ class BoardTest extends \PHPUnit_Framework_TestCase {
|
|||||||
'owner' => "admin",
|
'owner' => "admin",
|
||||||
'color' => "000000",
|
'color' => "000000",
|
||||||
'labels' => array(),
|
'labels' => array(),
|
||||||
|
'permissions' => [],
|
||||||
|
'deletedAt' => 0,
|
||||||
'acl' => array(),
|
'acl' => array(),
|
||||||
'archived' => false
|
'archived' => false
|
||||||
], $board->jsonSerialize());
|
], $board->jsonSerialize());
|
||||||
@@ -35,6 +37,8 @@ class BoardTest extends \PHPUnit_Framework_TestCase {
|
|||||||
'owner' => "admin",
|
'owner' => "admin",
|
||||||
'color' => "000000",
|
'color' => "000000",
|
||||||
'labels' => array("foo", "bar"),
|
'labels' => array("foo", "bar"),
|
||||||
|
'permissions' => [],
|
||||||
|
'deletedAt' => 0,
|
||||||
'acl' => array(),
|
'acl' => array(),
|
||||||
'archived' => false
|
'archived' => false
|
||||||
], $board->jsonSerialize());
|
], $board->jsonSerialize());
|
||||||
@@ -56,6 +60,8 @@ class BoardTest extends \PHPUnit_Framework_TestCase {
|
|||||||
'owner' => "admin",
|
'owner' => "admin",
|
||||||
'color' => "000000",
|
'color' => "000000",
|
||||||
'labels' => array(),
|
'labels' => array(),
|
||||||
|
'permissions' => [],
|
||||||
|
'deletedAt' => 0,
|
||||||
'acl' => array(),
|
'acl' => array(),
|
||||||
'archived' => false,
|
'archived' => false,
|
||||||
'shared' => 1,
|
'shared' => 1,
|
||||||
|
|||||||
@@ -148,10 +148,7 @@ class BoardServiceTest extends \Test\TestCase {
|
|||||||
$this->boardMapper->expects($this->once())
|
$this->boardMapper->expects($this->once())
|
||||||
->method('find')
|
->method('find')
|
||||||
->willReturn($board);
|
->willReturn($board);
|
||||||
$this->boardMapper->expects($this->once())
|
$this->assertEquals($board, $this->service->delete(123));
|
||||||
->method('delete')
|
|
||||||
->willReturn(1);
|
|
||||||
$this->assertEquals(1, $this->service->delete(123));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testAddAcl() {
|
public function testAddAcl() {
|
||||||
|
|||||||
Reference in New Issue
Block a user