Permissions

Description

When you create or edit a web component you might want to give some users the ability to delete, modify, and or insert records.

At the same time, you might want to deny this ability to other users. In order to achieve this in Alpha Anywhere you will first have to define what groups you wish to create by setting up your web security. Once you have some groups and users defined setting what permission each group has over a component is relatively easy.

Below you can see how adding permissions to a grid alters their final look. This is the same grid that was created in the 'Creating a Grid for Microsoft Access Using the SQL Builder' Guide. The user on the left can enter information into open fields, delete it, save entered information, undo changes using the undo button, and ultimately Submit everything. The grid on the right has had security added to it such that only one group has access to it. Users without access can see records in this grid but they can not alter those records or add new ones. See also: Web Application Security Guide

images/B_WithoutSecurity.png
images/B_WithSecurity.png

Controlling Record Updates:

  1. If you have set up Web Security already, Go to the Web Projects Control Panel and click to open the Select Grid Component Dialog.

    • 1. Alternatively, click New on the Web Projects Control Panel toolbar.

    • 2. In the New File Dialog select Web Component and click Next.

    • 3. When asked what type file you want to create, click Grid and Next.

  2. The Select Grid Component Dialog will load. Leave the 'Start with a blank Grid Component' radio button checked and click OK .

  3. The Grid Builder Dialog will load. On the Component Type page at the top of the Component Type tree menu select the Grid is: Updateable radio button. The Update Settings option will not appear in the Component Type tree if you do not select Updateable.

    images/B_addrecords.png
  4. Go to Grid > Update Settings .

  5. Under the Update Settings Permissions options you can adjust a groups ability to delete, update, or insert records into a component. The permission property for a grid is compared to a protected session variable named session.protectedSecurityLevel. Your application code should set this variable to reflect the permissions of the current user

Allow delete

tmpl.edit.allow_delete as L

Delete Security Groups

If you want to allow the user to delete records, optionally change the Permissions > Delete Security Groups. The groups of users you select from the Select Groups Allowedmenu on the Delete Allowed Security Groups Dialog will be allowed to delete records. If a user does not belong to one of these allowed groups then delete check boxes in the grid and delete buttons in the detail view will not be displayed.

images/B_Deleterecords.png

Allow Update

tmpl.edit.allow_update as L

Update Security Settings

Similarly, if you want to allow the user to update records, optionally change the Permissions > Update Security Groupssettings by clicking the text next to the option. The groups you select will be allowed to edit records. If the user is logged on with insufficient security for update, delete and insert, then the 'Submit' button on the Grid will not be displayed.

Allow insert

tmpl.edit.allow_insert as L

Insert Security Groups

If you want to allow the user to insert records change the Permissions > Insert Security Groups setting . Users with an insert security permission will be allowed to insert records. If the user is logged on with an insufficient Security Level then the 'Add' button is in the Detail View will not be displayed.

Number of new record rows

The Number of new record rows property changes the number of empty new record rows at the bottom of an updateable grid. The default number of empty rows is 3.

tmpl.edit.number_of_insert_rows as N

New record rows position

You can specify where the empty rows that are used to add new records to an editable grid should be positioned. Empty rows can be placed above, or below the existing records by choosing either Top or Below from the dropdown. Below is the default.

images/01_emptybelow.png
New record rows position set to Below.
images/01_emptybelow2.png
New record rows position set to Top

'Delete security level  
tmpl.edit.DeleteSecurityLevel as N 
'Update security level  
tmpl.edit.UpdateSecurityLevel as N 
'Insert security level  
tmpl.edit.InsertSecurityLevel as N