User
: Represents a user on the Instagram platform.
Account
: Represents a user account on Instagram. Accounts have owners, followers, and can follow other accounts.
Post
: Represents a post on Instagram. Posts are linked to accounts and can have restricted comments and likes.
Can user:kevin view account:1?
user:kevin
is the owner of account:1
. Hence, user:kevin
should be able to view account:1
. The expected result is 'true'
.Can user:kevin view account:2 ?
user:kevin
follows account:2
. Hence, user:kevin
should be able to view account:2
because he is a follower. The expected result is 'true'
.Can user:george view account:1 ?
user:george
can view account:1
, because the account is public. Hence, user:george
should be able to view account:1
. The expected result is 'true'
.Can user:george view account:2 ?
user:george
is the owner of account:2
. Hence, user:george
should be able to view account:2
. The expected result is 'true'
.Can user:george view post:1 ?
post:1
is linked with account:1
, and it does not have restricted access. Also, user:george
is following account:1
. Hence, user:george
should be able to view post:1
. The expected result is 'true'
.Can user:kevin view post:2 ?
post:2
is linked with account:2
, and it has restricted access. Also, user:george
is not following account:1
. Hence, user:kevin
should not be able to view post:2
. The expected result is 'false'
.Can user:george view post:2 ?
post:2
is linked with account:2
, and it is restricted access. Also, user:george
can view his own post:2
. The expected result is 'true'
.Can user:george comment post:1 ?
post:1
is linked with account:1
, and it is not restricted. Also, user:george
can comment on post:1
. The expected result is 'true'
.Can user:kevin comment post:2 ?
post:2
is linked with account:2
, and it is restricted. user:kevin
cannot comment on post:2
. The expected result is 'false'
.make serve
permify validate {path of your schema validation file}
to start the test process.
The validation result according to our example schema validation file: