mirror of
https://github.com/OpenHands/OpenHands.git
synced 2026-03-22 13:47:19 +08:00
Co-authored-by: openhands <openhands@all-hands.dev> Co-authored-by: rohitvinodmalhotra@gmail.com <rohitvinodmalhotra@gmail.com> Co-authored-by: Hiep Le <69354317+hieptl@users.noreply.github.com> Co-authored-by: Tim O'Farrell <tofarr@gmail.com>
22 lines
568 B
Python
22 lines
568 B
Python
"""
|
|
SQLAlchemy model for Role.
|
|
"""
|
|
|
|
from sqlalchemy import Column, Identity, Integer, String
|
|
from sqlalchemy.orm import relationship
|
|
from storage.base import Base
|
|
|
|
|
|
class Role(Base): # type: ignore
|
|
"""Role model for user permissions."""
|
|
|
|
__tablename__ = 'role'
|
|
|
|
id = Column(Integer, Identity(), primary_key=True)
|
|
name = Column(String, nullable=False, unique=True)
|
|
rank = Column(Integer, nullable=False)
|
|
|
|
# Relationships
|
|
users = relationship('User', back_populates='role')
|
|
org_members = relationship('OrgMember', back_populates='role')
|