Skip to content

Instantly share code, notes, and snippets.

@AdamSaleh
Created November 6, 2015 07:16
Show Gist options
  • Save AdamSaleh/aa4f4655091f677b3e89 to your computer and use it in GitHub Desktop.
Save AdamSaleh/aa4f4655091f677b3e89 to your computer and use it in GitHub Desktop.
behavior: "User login"
given: user $LOGIN $PASSWORD created
when: login $LOGIN $PASSWORD
then: user $LOGIN loggedin
precondition: user $LOGIN has-privilege-to $ACTION $SCOPE $OBJECTS
given: team $TEAM created
given: team $TEAM contains $LOGIN
given: team $TEAM has-privilege-to $ACTION $SCOPE $OBJECTS
behavior: "Team create"
given: user $LOGIN loggedin
given: user $LOGIN with-privilege-to WRITE ALL TEAMS
when: create team $TEAM
then: team $TEAM created
behavior: "Team privileges"
given: user $LOGIN loggedin
given: user $LOGIN with-privilege-to WRITE ALL TEAMS
when: add-privilege $ACTION $SCOPE $OBJECT to-team $TEAM
where: $ACTION in NONE READ WRITE
where: $SCOPE in ALL NONE
where: $OBJECT in TEAMS USERS
then: team $TEAM has-privilege-to $ACTION $SCOPE $OBJECTS
behavior: "Team user"
given: user $LOGIN loggedin
given: user $LOGIN with-privilege-to WRITE ALL TEAMS
when: add-user $LOGIN2 to-team $TEAM
then: team $TEAM contains $LOGIN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment