////
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

https://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.
////

[[permitted]]
=== permitted

.Purpose

Renders the body if the user is granted the specified permission(s)

.Examples

Single String:

[source,xml]
----
<sec:permitted className='com.foo.Report' id='${reportId}' permission='read'>

the body content

</sec:permitted>
----

Multiple String:

[source,xml]
----
<sec:permitted className='com.foo.Report' id='${reportId}' permission='write,read'>

the body content

</sec:permitted>
----

Single Permission:

[source,xml]
----
<%@ page import="org.springframework.security.acls.domain.BasePermission" %>

<sec:permitted className='com.foo.Report' id='${reportId}' permission='${BasePermission.READ}'>

the body content

</sec:permitted>
----

List of Permission:

[source,xml]
----
<%@ page import="org.springframework.security.acls.domain.BasePermission" %>

<sec:permitted className='com.foo.Report' id='${reportId}' permission='${[BasePermission.WRITE,BasePermission.READ]}'>

the body content

</sec:permitted>
----

Single mask int:

[source,xml]
----
<sec:permitted className='com.foo.Report' id='${reportId}' permission='${1}'>

the body content

</sec:permitted>
----

Multiple mask int:

[source,xml]
----
<sec:permitted className='com.foo.Report' id='${reportId}' permission='2,1'>

the body content

</sec:permitted>
----

.Description

Renders the body if the user has grants for the specified permissions. Permissions are specified in the "`permission`" attribute and can be a single Permission, an array of Permission, an int/Integer (which is assumed to be a mask), a String (which can be a single name, or a comma-delimited list of names, or a comma-delimited list of masks), or a List of any of these.
