You are viewing limited content. For full access, please sign in.

Question

Question

Retrieving the Everyone Group via Repository Access

SDK
asked on February 23, 2016 Show version history

Hello Laserfiche-ers!

I'm trying to set an attribute on the Everyone group. I know how to set attributes on users in general via RA, but I can't seem to figure how to get the Everyone group.

Here is the code that I'd like to use:

Dim attributes As TrusteeAttributeCollection = Trustee.GetAttributes(New AccountReference("What the heck goes here?", Me.RASession), Me.RASession)

attributes(foo) = bar

attributes.Save()

The code above works great for normal Laserfiche users, but I can't figure out what identifier to use for the Everyone group.

Any help would be much appreciated! Thanks!

1 0

Answer

SELECTED ANSWER
replied on February 24, 2016

The Everyone group is the Windows account with SID "S-1-1-0":

TrusteeAttributeCollection everyoneAttributes = Trustee.GetAttributes(new SecurityIdentifier("S-1-1-0"), session);

 

0 0
replied on February 24, 2016

Thanks Robbie!

Also, just a heads up to anyone that uses the code above, ensure that your project/workflow/whatever has `Imports System.Security.Principal`. This is required in order to access the `SecurityIdentifier` object.

0 0

Replies

replied on February 24, 2016

I believe also that \Everyone works if you want to use an account name, but I haven't tested that recently. However, if you do see \Everyone as an account name in a result, know that it refers to the special Everyone principal and not just a LF group with the name "Everyone".

2 0
replied on February 24, 2016 Show version history

Hey, quick follow up question...

When setting attributes on a user/group via the SDK, do I need to lock the trustee before making changes?

I'm setting attributes via Workflow, so I need my code to be thread-safe. For example, what if Workflow X runs twice at the same instant (via separate threads), and both try to add attributes to the same user at the same time? For Laserfiche entries, this is protected against via locking, but I don't see any locking options in the SDK for users/groups (in my case, for the Everyone group).

Is this something that I should be concerned about? Thanks!

0 0
replied on February 24, 2016

You only need to be concerned about thread synchronization with the trustee objects if multiple threads are sharing the same in-memory object, which I don't think is possible with WF activities. Each activity would get its own TrusteeAttributeCollection by calling Trustee.GetAttributes

1 0
You are not allowed to follow up in this post.

Sign in to reply to this post.