chore: initial commit — UdyamLinc backend, phases A-E
Spring Boot 4 / Java 17 / Postgres. Masters and serving (A), Agmarknet and climate ingestion (B), feature store with 14 derivations (C), SpEL rule engine and risk scoring (D). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
package com.lincfusion.udyamlinc.master;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import lombok.*;
|
||||
|
||||
/** Console RBAC. Permissions are a comma-separated set of MODULE:ACTION keys. */
|
||||
@Entity
|
||||
@Table(name = "role", indexes = @Index(name = "ix_role_code", columnList = "code", unique = true))
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public class Role {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
|
||||
/** FIELD_OFFICER | SUPERVISOR | OWNER */
|
||||
@Column(nullable = false, unique = true, length = 32)
|
||||
private String code;
|
||||
|
||||
@Column(nullable = false, length = 64)
|
||||
private String name;
|
||||
|
||||
/** e.g. "PORTFOLIO:VIEW,ALERT:ACT,VISIT:LOG" */
|
||||
@Column(length = 600)
|
||||
private String permissions;
|
||||
|
||||
/** System roles cannot be deleted from the console. */
|
||||
private Boolean systemRole;
|
||||
|
||||
private Boolean active;
|
||||
|
||||
@PrePersist
|
||||
void onCreate() {
|
||||
if (active == null) active = Boolean.TRUE;
|
||||
if (systemRole == null) systemRole = Boolean.FALSE;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user