Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Permissions
Ottawa_IWOV
Hi All -
Is there a programmatic way (i.e. Perl) to determine if a user has permission to a cetain area in TeamSite? Basically, CGI program will look at the user, then determine if he has access to a certain Searchable area in TeamSite.
Thoughts?
Platform TeamSite 6.5 SP1, Search 1.0 SP1
Windows 2003 EE
Find more posts tagged with
Comments
pbenn
Use the -X class of unary operator for your needs. E.g.
if (-r $filename) {
#readable by effective uid of cgi script
}
If the cgi task isn't being run by the user who's permissions you want to check, things get more complicated. I don't pretend this is the most efficient way to do this:
0) Get the user attributes using getpwnam($username)
1) Get the file attributes using stat($filename)
3) Compare the user attributes against the file attributes, namely
a) Compare user and group ownership of file against user id/group id
b) Compare user and group permissions of file against user id/group id
For example, if the permissions on the file are -r--rw-r-- and the user's group matches the file group (but isn't s/he isn't the owner) then the user can edit the file
This will become tedious, but hopefully you don't have to check every case (e.g. you know that the file will never be owned by the user)
P.