= ApplicationPermission
:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR  CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Specifies how a particular _#getRole() application role_ may interact with a specific xref:refguide:applib:index/services/appfeat/ApplicationFeature.adoc[ApplicationFeature] .

Each permission has a _#getRule() rule_ and a _#getMode() mode_ . The xref:refguide:extensions:index/secman/applib/permission/dom/ApplicationPermissionRule.adoc[ApplicationPermissionRule] determines whether the permission _ApplicationPermissionRule#ALLOW grants_ access to the feature or _ApplicationPermissionRule#VETO veto_ es access to it. The xref:refguide:extensions:index/secman/applib/permission/dom/ApplicationPermissionMode.adoc[ApplicationPermissionMode] indicates whether the role can _ApplicationPermissionMode#VIEWING view_ the feature or can _ApplicationPermissionMode#CHANGING change_ the state of the system using the feature.

For a given permission, there is an interaction between the xref:refguide:extensions:index/secman/applib/permission/dom/ApplicationPermissionRule.adoc[ApplicationPermissionRule] and the xref:refguide:extensions:index/secman/applib/permission/dom/ApplicationPermissionMode.adoc[ApplicationPermissionMode] :

* for an _ApplicationPermissionRule#ALLOW allow_ , a _ApplicationPermissionMode#CHANGING usability_ allow implies _ApplicationPermissionMode#VIEWING visibility_ allow.
* conversely, for a _ApplicationPermissionRule#VETO veto_ , a _ApplicationPermissionMode#VIEWING visibility_ veto implies a _ApplicationPermissionMode#CHANGING usability_ veto.

== API

[source,java]
.ApplicationPermission.java
----
class ApplicationPermission {
  public static final String LOGICAL_TYPE_NAME;
  public static final String SCHEMA;
  public static final String TABLE;
  String title()
  String getSort()
  ApplicationFeature findFeature(ApplicationFeatureId featureId)
  Optional<ApplicationFeatureId> asFeatureId()
  int compareTo(org.apache.isis.extensions.secman.applib.permission.dom.ApplicationPermission other)
  boolean equals(Object other)
  int hashCode()
  String toString()
}
----

