blob: 91266cf448482d36ca8865c5fc555704ced81000 [file] [log] [blame]
/**
*
* Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation
*
*/
grammar org.eclipse.osbp.xtext.authorizationdsl.AuthorizationDSL with org.eclipse.osbp.xtext.oxtype.OXtype
import "http://osbp.eclipse.org/xtext/authorizationdsl/AuthorizationDSL"
import "http://osbp.eclipse.org/xtext/blip/BlipDSL" as blip
import "http://osbp.eclipse.org/dsl/common/types/v1" as types
import "http://osbp.eclipse.org/dsl/entity/v1" as entity
import "http://osbp.eclipse.org/dsl/dto/v1" as dto
import "http://www.eclipse.org/emf/2002/Ecore" as ecore
AuthorizationModel:
importSection=XImportSection?
pckg=AuthorizationPackage;
AuthorizationPackage:
{AuthorizationPackage} 'package' name=QualifiedName '{' (roles+=Role)* '}';
Role:
'role' name=TRANSLATABLEID '{' roleElements+=RoleElement* '}';
RoleElement:
RoleEntity | RoleBean | RoleDto | RoleBlipProcess;
RoleEntity:
{RoleEntity} 'entity' entityRef=[entity::LEntity] entityAuthorized+=RoleEnum+ ('{' entityFeatures+=RoleEntityFeature+ '}')?;
RoleBean:
{RoleBean} 'bean' beanRef=[entity::LBean] beanAuthorized+=RoleEnum+ ('{' beanFeatures+=RoleBeanFeature+ '}')?;
RoleDto:
{RoleDto} 'dto' dtoRef=[dto::LDto] dtoAuthorized+=RoleEnum+ ('{' dtoFeatures+=RoleDtoFeature+ '}')?;
RoleBlipAllUserTasks:
{RoleBlipAllUserTasks} 'all' 'usertasks' authorized=RoleBlipUserTaskEnum;
RoleBlipUserTask:
{RoleBlipUserTask} 'usertask' userTask=[blip::BlipUserTask|QualifiedName] authorized=RoleBlipUserTaskEnum;
RoleBlipProcess:
{RoleBlipProcess} 'process' process=[blip::Blip] '{'
('is' processStartAuthorized=RoleBlipProcessEnum)?
(allUserTasks=RoleBlipAllUserTasks)?
(userTasks+=RoleBlipUserTask)*
'}';
RoleEntityFeature:
RoleEntityAttribute | RoleEntityReference;
RoleEntityAttribute:
'attribute' entityAttriCol=[entity::LEntityAttribute] entityAttriUnauthorized=RolePropertyEnum;
RoleEntityReference:
'relation' entityAttriCol=[entity::LEntityReference] entityAttriUnauthorized=RolePropertyEnum;
RoleBeanFeature:
RoleBeanAttribute | RoleBeanReference;
RoleBeanAttribute:
'attribute' beanAttriCol=[entity::LBeanAttribute] beanAttriUnauthorized=RolePropertyEnum;
RoleBeanReference:
'relation' beanAttriCol=[entity::LBeanReference] beanAttriUnauthorized=RolePropertyEnum;
RoleDtoFeature:
RoleDtoAttribute | RoleDtoReference;
RoleDtoAttribute:
'attribute' dtoAttriCol=[dto::LDtoAttribute] dtoAttriUnauthorized=RolePropertyEnum;
RoleDtoReference:
'relation' dtoAttriCol=[dto::LDtoReference] dtoAttriUnauthorized=RolePropertyEnum;
enum RoleEnum:
any='ANY' | creatable='CREATABLE'| readable='READABLE' | updatable='UPDATABLE'| deletable='DELETABLE';
enum RolePropertyEnum:
invisible='INVISIBLE' | disabled='DISABLED' | noneditable='NONEDITABLE';
enum RoleBlipProcessEnum:
startable='STARTABLE';
enum RoleBlipUserTaskEnum:
executable='TASKABLE';
TRANSLATABLEID:
ID;