Skip to main content
Define your policy by creating a file api/policies/SwordPolicy:

API actions

There are 5 actions you can permit:
  1. Create: operations.CREATE aka SwordResource.create method
  2. Delete: operations.DELETE aka SwordResource().delete method
  3. Detail: operations.DETAIL aka SwordResource.member method
  4. List: operations.LIST aka SwordResource.collection method
  5. Update: operations.UPDATE aka SwordResource().update method

API scopes

There are 2 scopes you can permit:
  1. Private: OauthScope.CLIENT_PRIVATE; user must be logged in to have access
  2. Public: OauthScope.CLIENT_PUBLIC; user must be logged out to have access

Permit CRUD actions

Define which actions a user can perform:
If you want to permit certain actions for a user only if a condition is met, do the following:

Permit query parameters

Define which URL query parameters a user is allowed to use:
If you want to permit a different query parameter for a specific action, do the following:
You can also add a condition to these permissions:

Permit read attributes

Define which attributes of the resource the current user can read:

Permit write attributes

Define which attributes of the resource the current user can write to when creating a new resource or updating an existing resource: