Merge branch 'sharing_no_groups' of github.com:nextcloud/passman into sharing_no_groups

This commit is contained in:
brantje 2016-10-03 15:42:36 +02:00
commit 167ffd4644
No known key found for this signature in database
GPG key ID: 5FF1D117F918687F
5 changed files with 52 additions and 3 deletions

View file

@ -6,6 +6,7 @@
* @description * @description
* # MainCtrl * # MainCtrl
* Controller of the passmanApp * Controller of the passmanApp
* This file is part of passman, licensed under AGPLv3
*/ */
angular.module('passmanApp') angular.module('passmanApp')
.controller('ShareCtrl', ['$scope', 'VaultService', 'CredentialService', 'SettingsService', '$location', '$routeParams', 'ShareService', 'NotificationService', function ($scope, VaultService, CredentialService, SettingsService, $location, $routeParams, ShareService, NotificationService) { .controller('ShareCtrl', ['$scope', 'VaultService', 'CredentialService', 'SettingsService', '$location', '$routeParams', 'ShareService', 'NotificationService', function ($scope, VaultService, CredentialService, SettingsService, $location, $routeParams, ShareService, NotificationService) {

View file

@ -0,0 +1,44 @@
/**
* Created by Marcos Zuriaga on 3/10/16.
* This file is part of passman, licensed under AGPLv3
*/
angular.module('passmanApp').factory('SharingACL', function(){
function ACL(acl_permission){
var permission = acl_permission;
var permissions = {
READ: 0x01,
WRITE: 0x02,
FILES: 0x04,
HISTORY: 0x08,
OWNER: 0x80,
};
}
/**
* Checks if a user has the given permission/s
* @param permission
* @returns {boolean}
*/
ACL.prototype.hasPermission = function(permission){
return this.permission == (this.permission & permission);
};
/**
* Adds a permission to a user, leaving any other permissions intact
* @param permission
*/
ACL.prototype.addPermission = function(permission){
this.permission = this.permission | permission;
};
/**
* Removes a given permission from the item, leaving any other intact
* @param permission
*/
ACL.prototype.removePermission = function(permission){
this.permission = this.permission & !permission;
};
return ACL;
});

View file

@ -6,6 +6,7 @@
* @description * @description
* # ShareService * # ShareService
* Service in the passmanApp. * Service in the passmanApp.
* This file is part of passman, licensed under AGPLv3
*/ */
angular.module('passmanApp') angular.module('passmanApp')
.service('ShareService', ['$http', 'VaultService', 'EncryptService', 'CredentialService', function ($http, VaultService, EncryptService, CredentialService) { .service('ShareService', ['$http', 'VaultService', 'EncryptService', 'CredentialService', function ($http, VaultService, EncryptService, CredentialService) {

View file

@ -14,6 +14,8 @@ use OCP\AppFramework\Db\Entity;
class PermissionEntity extends Entity { class PermissionEntity extends Entity {
CONST READ = 0b00000001; CONST READ = 0b00000001;
CONST WRITE = 0b00000010; CONST WRITE = 0b00000010;
CONST FILES = 0b00000100;
CONST HISTORY = 0b00001000;
CONST OWNER = 0b10000000; CONST OWNER = 0b10000000;
/** /**

View file

@ -54,6 +54,7 @@ script('passman', 'app/services/encryptservice');
script('passman', 'app/services/tagservice'); script('passman', 'app/services/tagservice');
script('passman', 'app/services/notificationservice'); script('passman', 'app/services/notificationservice');
script('passman', 'app/services/shareservice'); script('passman', 'app/services/shareservice');
script('passman', 'app/factory/sharingacl');
script('passman', 'app/directives/passwordgen'); script('passman', 'app/directives/passwordgen');
script('passman', 'app/directives/fileselect'); script('passman', 'app/directives/fileselect');
script('passman', 'app/directives/progressbar'); script('passman', 'app/directives/progressbar');