Solved

Using Roles in Author fields

Posted on 2006-06-20
17
409 Views
Last Modified: 2013-12-18
Hi,

I am trying to use the following code in an Author field on a form:

@If(
site_country = "UK";  @UserName : "[UK]";
site_country = "Australia";  @UserName : "[Australia]";
site_country = "India";   @UserName : "[India]";
site_country = "China";  @UserName : "[China]";
site_country = "Malaysia";   @UserName : "[Malaysia]";
site_country = "Japan";   @UserName : "[Japan]";
site_country = "Germany";   @UserName : "[Germany]";
site_country = "South Africa";   @UserName : "[South Africa]";
"[Admin]")

Although this is seemingly valid, it doesn't seem to work as I would like.

What I am trying to achieve is to make documents only editable if the country matches the role, or if they were the original document authors.

If the site_country field doesn't match any of the listed countries I want it to be assigned role of "[Admin]"

The site_country field is a computed text field.

This is for Notes Client 6.53

Thanks.
0
Comment
Question by:shuboarder
  • 7
  • 5
  • 2
  • +2
17 Comments
 
LVL 63

Expert Comment

by:SysExpert
ID: 16942765
Where is the problem ?

1)  Are the contents of the Autor field correctly set ?
2) If the Author field is set correctly, is the person, and anyone in that country ACL able to edit ?

Please provide more details of the isse.

I hope this helps !
0
 
LVL 21

Author Comment

by:shuboarder
ID: 16942884
Hi SysExpert,

1) when a new document is created it is setting Author field to [Admin]

Once the site is selected from the comobobox this is changing to something like:

John Smith ; [UK]

These seems to be ok?

2) When I create a new document it assigns role [Admin]
This should mean that only people with role of [Admin] can edit it.
However it seems that it is still editable by anyone. i.e. [UK]
0
 
LVL 43

Expert Comment

by:Steve Knight
ID: 16942960
Not sure what your issues is specifically but, probably because I'm lazy for repeat typing, I'd probably lay it out slightly differently as:

sitelist:= "UK": "Australia": "India": "China" etc...
@If(site_country=sitelist;@UserName:"[" + site_country + "]");[Admin]);

As SysExpert says what are the issues?  Presume the roles are defined in the ACL and users assigned to them on the remote replicas etc. (I assume server per country).  Silly question too but are local replicas involved at all?

Steve
0
 
LVL 43

Expert Comment

by:Steve Knight
ID: 16942982
Previous post being typed while your reply came in...

If it is editable by anyone then either there is another author field, the user has the role or editor in ACL etc.  Try it as a normal user and see what @UserRoles resolves to or click the button in the toolbar to see what roles are assigned.  Presumably the user involved is only an author in the ACL?
0
 
LVL 21

Author Comment

by:shuboarder
ID: 16943297
All of the roles in the ACL have editor access

i.e. India group has editor access with role of editor.
Does this override the role itself?

I have added a reader field with the same formula, and this appears to be preventing the document from appearing now. Can I hide the category of the country as well?
0
 
LVL 21

Author Comment

by:shuboarder
ID: 16943419
Thinking about it, this would make perfect sense.

Everyone has author access until the author field gives them editor access.

Is that correct?

Can anyone help me further by explaining how I might get rid of the category that displays the document

Country
           Site
                 Description
                                 Document

Currently the document part is working in that people that shouldn't be able to edit it can't even see it.
How can I also not display the 3 categories leading up to this document?

Thanks

                 
0
 
LVL 63

Expert Comment

by:SysExpert
ID: 16943496
I would definitely set the users to Author rather than editor as a start.
Also, are there any other Author/reader fields in the form ?

Unless you enforce a consistant ACL( Advanced setting in ACl )  , Then anyone with a local copy wil be able to do anything.

I hope this helps !
0
 
LVL 21

Author Comment

by:shuboarder
ID: 16943768
I have set the groups to Author access now.
I can't see any other author/reader fields on the form, but does this necessarily mean they do not exist?
Constant ACL is being enforced already - thanks
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 43

Assisted Solution

by:Steve Knight
Steve Knight earned 450 total points
ID: 16943888
Hang on did you say the role has Editor access in the ACL?  You should have something like:

UserGroupUK  Author
UserGroupAustralia Author
Admins Manager

then the UserGroupUk (or individuals listed) has UK role ticked
and UserGroupAustralia (or individuals listed) has Australia role ticked

then in the document you give the role Author access to it so if the user is in UK group they get Uk role and author access (i.e. they can edit) the UK documents.

Have you got [UK] type role entries listed directly in the ACL?

At no time should editor access be needed for this -- even if someone needs access to all areas you could do it by giving them all the relevant roles through a group or directly.

Steve
0
 
LVL 43

Accepted Solution

by:
Steve Knight earned 450 total points
ID: 16943903
<<Currently the document part is working in that people that shouldn't be able to edit it can't even see it.
How can I also not display the 3 categories leading up to this document?>>

There is a property on the view (4th or 5th tab, cna't remember off hand) "don't display catgeroies with zero documents" which should do that.
0
 
LVL 43

Assisted Solution

by:Steve Knight
Steve Knight earned 450 total points
ID: 16943937
Re: the Readers field be careful.  A readers field specifies exactly everything that can see the document.  I always add an extra readers field with an admin role / server name or role listed aswell in case the main one gets corrupted etc. especially when it is a computed field like this as otherwise you could easily 'lose' documents that you can't see either.  

If you have a readers field you MUST be in that field to get any kind of access to the document at all.
If an only if you are an author in the ACL then an authors field allows you to edit that document.

hth

Steve
0
 
LVL 46

Assisted Solution

by:Sjef Bosman
Sjef Bosman earned 50 total points
ID: 16947254
Formula correction:
    sitelist:= "UK": "Australia": "India": "China" etc...
    @If(site_country=sitelist;@UserName:("[" + site_country + "]"));[Admin]);

I'm too tired to read all your comments, but: an Authors field only works when someone has Author rights to begin with. You can NEVER turn a Reader into an Author, nor can you prevent an Editor from changing a document even if he's not mentioned as an Author.
0
 
LVL 18

Expert Comment

by:marilyng
ID: 16947396
sjef has the formula correct, except for a typo in the Admin :

     sitelist:= "UK": "Australia": "India": "China" etc...
    @If(site_country=sitelist;@UserName:("[" + site_country + "]"));"[Admin]");



0
 
LVL 43

Expert Comment

by:Steve Knight
ID: 16948612
Actually I think we all had a typo or two - I had left a bracket and to quotes out and now there is an extra bracket.  Think this is it :-)

sitelist:= "UK": "Australia": "India": "China" etc...
    @If(site_country=sitelist;@UserName:("[" + site_country + "]");"[Admin]");




0
 
LVL 18

Expert Comment

by:marilyng
ID: 16950120
Sorry, didn't read all the way to the top, yeah, slap those nasty pda's for making the screen too small to see the typos.
0
 
LVL 43

Expert Comment

by:Steve Knight
ID: 16950192
Thanks for the points.... will hit that first 50,000 in TA yet :-)
0
 
LVL 21

Author Comment

by:shuboarder
ID: 16950262
Thank you!

I've kept my original formula as it works for me...

It was just the access level in the ACL that needed changing and the "don't display empty categories" 3rd tab in the view properties that needed checking.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now