Skip to content
/ pac Public

role-based access control implemented with sql relations

License

Notifications You must be signed in to change notification settings

romeq/pac

Repository files navigation

PAC

Role-based access control implemented with SQL's relations.

This was made completely only for playing around with sqlc + postgresql and docker compose.

This is not intended to be actually used as there might be some security flaws. Please note that this software wasn't tested for security in any other way than manually checking if a resource is limited only to a specific group.

Setup

I don't know why you would want to setup this, but oh boy it's easy (I'm just extremely lazy and don't want to reproduce things constantly).

git clone [email protected]:romeq/pac.git
# or alternatively via http:
# git clone https://github.com/romeq/pac.git
docker-compose up

Architecture

Architecture for this is clearly rather simple. Therefore I'll just write it down.

Database

Table name Description
role Roles and their private information (such as roles' names)
account Accounts and account related information
account_to_role Account roles
resource Resources's uuids and contents
resource_to_role Keeps track of what roles are allowed to access a specific resource

Tables

Column name Description
role_uuid Unique identifier for role, used to refer a specific record
name Name of the role
Column name Description
account_uuid Unique identifier for account, used to refer a specific record
name Username of the account
Column name Description
account_uuid References account-table's role_uuid-column
role_uuid References role-table's role_uuid-column
Column name Description
resource_uuid Unique identifier for resource, primarily used to refer a specific record
content Resource content (string)
Column name Description
resource_uuid References resource-table's role_uuid-column
role_uuid References role-table's role_uuid-column

About

role-based access control implemented with sql relations

Resources

License

Stars

Watchers

Forks

Packages

No packages published