Use Privilege-role system instead of enum Role one

This commit is contained in:
2025-05-27 00:45:51 +05:00
parent 0f89a1baa7
commit 96ca31e536
22 changed files with 572 additions and 104 deletions

View File

@ -1,11 +1,30 @@
jwt:
secret: ${JWT_SECRET}
expiry:
access:
USER: 1d
MODER: 12h
ADMIN: 30m
refresh:
USER: 90d
MODER: 7d
ADMIN: 2h
authorization:
roles:
- name: ROLE_USER
access-expiry: '1d'
refresh-expiry: '90d'
privileges:
- READ_PRIVILEGE
- name: ROLE_ADMIN
access-expiry: '30m'
refresh-expiry: '2h'
privileges:
- WRITE_PRIVILEGE
- CHANGE_PASSWORD_PRIVILEGE
hierarchy: |
ROLE_ADMIN > ROLE_USER
default-role: ROLE_USER
spring:
datasource:
url: ${DATABASE_URL}
username: ${DATABASE_USERNAME}
password: ${DATABASE_PASSWORD}
jpa:
hibernate:
ddl-auto: none
server:
error:
include-message: always