Skip to content

Add an authorization mechanism based on Casbin #368

@hsluoyz

Description

@hsluoyz

Hi, I'm the author of Casbin. It is a Go authorization library that supports access control models like ACL, RBAC, ABAC. It's already used in some large systems, mostly web frameworks. See details here: https://github.com/casbin/casbin

I noticed that semaphore still lacks an authorization mechanism, and there's demand for it (see: #344). (Thanks to @matejkramny for pointing it out for me:)) I think a RBAC-based authorization will fit in our scenario. About our scenario, Casbin can provide:

  1. roles can be global or within a tenant (aka project). So the platform owner can have a global admin role, and the project owner will have a local admin role, which only works inside his project.
  2. roles can be cascaded. e.g. admin role can be a member of template admin and task admin roles. So admin role will have all the permissions that are assigned to template admin and task admin.
  3. support permission groups (like roles). This is useful when you want to group the permissions.
  4. the permission granting and user-role mapping can be persisted in files or database (MySQL, NoSQL, etc), support for other DBs can be added if needed.

So what do you think? I can make PR if it's OK. Thanks!

@matejkramny @strangeman

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions