gd_addusers

Grants an array of users or user groups permission to access some data (file, variable or datagroup).

 

Syntax

success = gd_addusers(ID,users,accesstype='users')

success = gd_addusers(datagroupID,users,

                     accesstype='users')

 

Description

success = gd_addusers(ID,users) grants other users permission to query or retrieve a file or variable, specified by its ID. A userID for each user should be provided in the users list.  Alternatively a single user can be specified as a string.

 

success = gd_addusers(datagroupID,users) is similar but grants other users permission to query a datagroup, specified by its ID.

 

success = gd_addusers(ID,groups,'groups') grants a group of users permission to query or retrieve a file or variable, specified by its ID. A groupID for each user group should be provided in the groups list. Alternatively a single group can be specified as a string. Every registered user is a member of the built in group 'allusers' and other user groups can be set up by the database administrator.

 

success = gd_addusers(datagroupID,groups,'groups') is similar but grants a group of users permission to query a datagroup, specified by its ID.

 

The function returns 1 if successful, or 0 if failed (for example if one of the users already has access permission or does not exist). All valid userIDs or groupsIDs in the list will be granted permission, and a warning message will be displayed for any that fail.

 

Example

Grant users with user IDs user1 and user2 access to an archived file.

 

from gddatabase import *

fileID = gd_archive('C:/file.dat')

users = ['user1','user2']

gd_addusers(fileID,users)

 

Grant all registered users access to an archived file.

 

gd_addusers(fileID,'allusers','groups')

 

Notes

You must be the owner of the data to give others permission to access it.

 

A valid proxy certificate is required (see gd_createproxy from the Geodise Compute Toolbox).

 

Your certificate subject must have been added to the authorisation database.

 

See also

gd_archive, gd_datagroup, gd_query, gd_createproxy



dbtoolbox

contents

gd_archive

Copyright © 2005, The Geodise Project, University of Southampton