Rake tasks for configuring shares permissions on Shares

Rake tasks are scripts that allow you to retrieve, delete or update information on your Shares server using the command line. Rake tasks can perform actions on user accounts, shares and nodes. This article describes the rake tasks available for configuring user or group permissions of shares. For more general information on Shares rake tasks see this article (Shares rake tasks).

Configuring share permissions for a user

This rake task allows you to configure the permissions a particular user has for a particular share. For example, you may want a certain user to have the ability to browse and download from a share, but not delete files within it.

The syntax for this rake task is the following:

Rake tasks must be run from within the appropriate location in the shares folder:
  • Linux Shares 1.8 and later: /opt/aspera/shares/u/shares/bin
  • Linux Shares earlier than 1.8: /opt/aspera/shares/u/shares
  • Windows: C:\Shares\www
Windows
rake data:user:share_permissions -- [options]

Shares 1.8+
./run rake data:user:share_permissions -- [options]

Shares earlier than 1.8
bundle exec rake data:user:share_permissions -- [options]

 

The available options are the following:

option description                                                                                     
--username username
The name of the user (required).
--share_name share_name The name of the share (required).
--browse_permission true|false Whether the user can browse the share.
--download_permission true|false Whether the user can download from the share.
--mkdir_permission true|false Whether the user can create a directory in the share.
--delete_permission true|false Whether the user can delete files or directories in the share.
--rename_permission true|false Whether the user can rename files or directories in the share.
--content_availability_permission true|false Whether the user receives notifications of content availability in a share.

--manage_permission true|false

 

 

Whether the user is given administrative privileges for the share and all

inherited subdirectories. Privileges include creating users, shares within the share

and managing shares authorizations.



You can include any combination and amount of permissions in the rake task.

By default users have the browse permission allowed on a share. If a user has no additional permissions configured but belongs to a group that does have permission configurations, the user will inherit those permissions. However, user permissions take precedence over group permissions.

Examples

To allow upload and ‘make directory’ permission on the share ProjectXYZ for user janedoe but to disallow download permission, you would use the following:

rake data:user:share_permissions -- --username janedoe --share_name ProjectXYZ  --upload_permission true  
--mkdir_permission true --download_permission false

 

To give the user hgranger all permissions for share H_History, including manager privileges, you would use the following:

rake data:user:share_permissions -- --username hgranger --share_name H_History --browse_permission true 
--upload_permission true  --download_permission true --mkdir_permission true --rename_permission true
--content_availability_permission true manage_permission true

 

Configuring share permissions for a group

This rake task allows you to configure the permissions the members of a particular group have for a particular share. For example, you may want the members of a certain group to have the ability to browse and upload to a share, but not download files within it.

The syntax for this rake task is the following:

Rake tasks must be run from within the appropriate location in the shares folder:
  • Linux Shares 1.8 and later: /opt/aspera/shares/u/shares/bin
  • Linux Shares earlier than 1.8: /opt/aspera/shares/u/shares
  • Windows: C:\Shares\www
Windows
rake data:group:share_permissions -- [options]

Shares 1.8+
./run rake data:group:share_permissions -- [options]

Shares earlier than 1.8
bundle exec rake data:group:share_permissions -- [options]

 

The available options are the following:

option description                                                                                      
--group_name group_name
The name of the group (required).
--share_name share_name The name of the share (required).
--browse_permission true|false Whether the user can browse the share.
--download_permission true|false Whether the user can download from the share.
--mkdir_permission true|false Whether the user can create a directory in the share.
--delete_permission true|false Whether the user can delete files or directories in the share.
--rename_permission true|false Whether the user can rename files or directories in the share.
--content_availability_permission true|false Whether the user receives notifications of content availability in a share.

--manage_permission true|false

 

 

Whether the user is given administrative privileges for the share and all

inherited subdirectories. Privileges include creating users, shares within the share

and managing shares authorizations.

You can include any combination and amount of permissions in the rake task. Note that user permissions take precedence over group permissions.

Example

To give members of the group office_users the permission to upload files to the share ProjectXYZ but to disallow the creation of new directories, you would use the following:

rake data:group:share_permissions -- --group_name office_users --share_name ProjectXYZ --upload_permission true 
--mkdir_permission false
Have more questions? Submit a request

0 Comments

Article is closed for comments.
Powered by Zendesk