View Selection

I have a view that shows employee time. I want most users to see only their time but some users will see all employees and their time. I’ve created a role called “SeeAllTime”. How do I write the select statement to check the current user against that role and if the user is not a member of that role just show his or her time. The field in the form that holds the employee name is called “Employee”

Thanks in advance.

Subject: It depends on whether it is a security issue or not

If the issue is that you do not want anyone to be able to see another persons time then the Reader field that has been suggested is the way to go. In a very large view there could well be a performance hit as the view evaluates the reader field on each document. If on the other hand it is more of a need to know (and most people would have no idea how to get around it) I would us a Single Category view. From the help “Also, if the Show Single Category formula evaluates to an asterisk (*), all categories are shown.” so your formula would look something like this.

@If(@IsMember(“[SeeAllTime]”;@UserRoles);*;@UserName)

This would in most cases be faster and easier than the readers field. The single view index would not have to be evaluated with each access. However, if it is a real security issue then the Readers Field is probably the only way to go.

Subject: View Selection

Check into reader name fields…

You could make the Employee field a reader name field…

and then have an additional reader name field that you put the role [SeeAllTime] in

This will all only the employee to see their documents unless they have the role SeeAllTime…

Read about Reader Name fields…

Subject: RE: View Selection

I was thinking something along the lines of

SELECT Form = “TimeSheet” & Status = “Approved” & @If(@IsMember(“[SeeAllTime]”;@UserRoles); Employee != “”; Employee = @Name([CN];@UserName))

but it doesn’t seem to be working

@If(@IsMember(“[SeeAllTime]”;@UserRoles)) is returning False

any ideas?