Page 1 of 1

about user and group permissions

Posted: Mon Mar 30, 2015 5:58 pm
by impartial49
Hi,

What are the different values for the permissions ?
I saw 11 available permissions, but i don't know how to combine them.
Thanks

Emmanuel

Re: about user and group permissions

Posted: Thu Apr 02, 2015 7:12 am
by mmeschieri
You find a description for each permission here: http://docs.logicaldoc.com/en/working-w ... s/security

Re: about user and group permissions

Posted: Thu Apr 02, 2015 1:31 pm
by impartial49
But for the web services ?
I'm developper and I want to grant a folder.

Const READ = ?
Const UPLOAD = ?
Const SAVE = ?
Const ADD = ?
Const SECURITY = ?
Const IMMUABLE = ?
Const DELETE = ?
Const RENAME = ?
Const IMPORT = ?
Const EXPORT = ?
Const SIGNATURE = ?


ld_Folder.grantUser(Sid, Folder.id, Account.id, READ && EXPORT, False)

Thanks
Emmanuel

Re: about user and group permissions

Posted: Fri Apr 03, 2015 8:34 am
by agaspa
Hi Emmanuel,
what is the programming language you're working with?

Re: about user and group permissions

Posted: Fri Apr 03, 2015 10:01 am
by agaspa
Hi Emmanuel,

this is a snippet of code in C#

Code: Select all

        private void button13_Click(object sender, EventArgs e)
        {
            const int READ = 1;
            const int WRITE = 2;
            const int ADD = 4;
            const int SECURITY = 8;         
            const int IMMUTABLE= 16; // you can turn the documents in folder to immutable
            const int DELETE= 32;
            const int RENAME= 64;
            const int IMPORT= 128;
            const int EXPORT= 256;
            const int SIGNATURE = 512;
            const int ARCHIVE = 1024;
            const int WORKFLOW = 2048;
            const int DOWNLOAD = 4096;
            const int CALENDAR = 8192;

            Folder.FolderServiceImplService fservice = new Folder.FolderServiceImplService();
            long folderID = fservice.createFolder(SID, 4, "New Folder");
            long userID = 3506176; // The user must exists!

            int permissions = READ ^ EXPORT; // this is a XOR operation

            Console.WriteLine(GetIntBinaryString(READ));
            Console.WriteLine(GetIntBinaryString(EXPORT));
            Console.WriteLine(GetIntBinaryString(permissions));

            fservice.grantUser(SID, folderID, userID, permissions, false);
        }

Re: about user and group permissions

Posted: Tue Apr 07, 2015 9:25 am
by impartial49
Thanks a lot. I'll try this.

Re: about user and group permissions

Posted: Tue Apr 14, 2015 7:15 am
by shrikant
Hi agaspa

I am also trying user/Role and Group permission in c#. and try to implement your code posted here but getting error on this method "GetIntBinaryString()".
please could you share the complete function so i can also try.
I have one more requirement could be handle the folder on user role based. if a user has 2 different roles and he has rights in 2 different folder according his role.
when he login at a time one role then he can access only related folder.

awaiting for your kind help.

Regards
Shrikant

Re: about user and group permissions

Posted: Tue Apr 14, 2015 8:28 am
by agaspa
Hi shrikant,
the method GetIntBinaryString() is purely secondary,
its purpose is to return a string in binary format of an integer, you can safely comment those lines.

Security in logicaldoc is managed at the level of folders for performance reasons.
On each folder you can specify a different set of permissions.
This way a user can see a folder and the documents it contains and not see another folder because he does not have read permissions.