mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-25 20:22:02 +00:00
20 lines
602 B
CoffeeScript
20 lines
602 B
CoffeeScript
|
define [], () ->
|
||
|
class PermissionsManager
|
||
|
constructor: (@ide, @$scope) ->
|
||
|
@$scope.$watch "permissionsLevel", (permissionsLevel) =>
|
||
|
@$scope.permissions =
|
||
|
read: false
|
||
|
write: false
|
||
|
admin: false
|
||
|
if permissionsLevel?
|
||
|
if permissionsLevel == "readOnly"
|
||
|
@$scope.permissions.read = true
|
||
|
else if permissionsLevel == "readAndWrite"
|
||
|
@$scope.permissions.read = true
|
||
|
@$scope.permissions.write = true
|
||
|
else if permissionsLevel == "owner"
|
||
|
@$scope.permissions.read = true
|
||
|
@$scope.permissions.write = true
|
||
|
@$scope.permissions.admin = true
|
||
|
|