001/* 002 * Licensed to the Apache Software Foundation (ASF) under one 003 * or more contributor license agreements. See the NOTICE file 004 * distributed with this work for additional information 005 * regarding copyright ownership. The ASF licenses this file 006 * to you under the Apache License, Version 2.0 (the 007 * "License"); you may not use this file except in compliance 008 * with the License. You may obtain a copy of the License at 009 * 010 * http://www.apache.org/licenses/LICENSE-2.0 011 * 012 * Unless required by applicable law or agreed to in writing, 013 * software distributed under the License is distributed on an 014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 015 * KIND, either express or implied. See the License for the 016 * specific language governing permissions and limitations 017 * under the License. 018 */ 019package org.apache.isis.extensions.secman.api.role; 020 021import org.apache.isis.extensions.secman.api.IsisModuleExtSecmanApi; 022 023public interface ApplicationRole { 024 025 public static final int MAX_LENGTH_NAME = 50; 026 public static final int TYPICAL_LENGTH_NAME = 30; 027 public static final int TYPICAL_LENGTH_DESCRIPTION = 50; 028 029 // -- EVENTS 030 031 public static abstract class PropertyDomainEvent<T> extends IsisModuleExtSecmanApi.PropertyDomainEvent<ApplicationRole, T> {} 032 public static abstract class CollectionDomainEvent<T> extends IsisModuleExtSecmanApi.CollectionDomainEvent<ApplicationRole, T> {} 033 public static abstract class ActionDomainEvent extends IsisModuleExtSecmanApi.ActionDomainEvent<ApplicationRole> {} 034 035 public static class AddUserDomainEvent extends ActionDomainEvent {} 036 public static class RemoveUserDomainEvent extends ActionDomainEvent {} 037 public static class AddActionDomainEvent extends ActionDomainEvent {} 038 public static class AddClassDomainEvent extends ActionDomainEvent {} 039 public static class AddCollectionDomainEvent extends ActionDomainEvent {} 040 public static class AddPackageDomainEvent extends ActionDomainEvent {} 041 public static class AddPropertyDomainEvent extends ActionDomainEvent {} 042 public static class RemovePermissionDomainEvent extends ActionDomainEvent {} 043 044 public static class DeleteDomainEvent extends ActionDomainEvent {} 045 046 public static class UpdateDescriptionDomainEvent extends ActionDomainEvent {} 047 public static class UpdateNameDomainEvent extends ActionDomainEvent {} 048 049 // -- MODEL 050 051 /** 052 * having a title() method (rather than using @Title annotation) is necessary as a workaround to be able to use 053 * wrapperFactory#unwrap(...) method, which is otherwise broken in Isis 1.6.0 054 */ 055 default String title() { 056 return getName(); 057 } 058 059 String getName(); 060 void setName(String name); 061 062 String getDescription(); 063 void setDescription(String description); 064 065 066}