Dashboard > blojsom > ... > Available Plugins > Permissions Check Plugin
  blojsom Log In   View a printable version of the current page.  
  Permissions Check Plugin
Added by David Czarnecki, last edited by David Czarnecki on Nov 19, 2005  (view change)
Labels: 
(None)

Availability

This plugin is available as of blojsom 2.28.

Description

Allows you to check permissions of a user of the blog in your templates. This would allow you to dynamically change the look and feel of your site, for example, adding or deleting menu options.

Installation and Setup

In your global /WEB-INF/plugin.properties file, add the following line:

permissions-check=org.blojsom.plugin.permission.PermissionCheckPlugin

You may then add "permissions-check" to the end one of the flavor-based plugin chains. These plugin chains can be found in the individual user's plugin.properties file. For example:

html.blojsom-plugin-chain=...,permissions-check

Usage and URL Parameters

There are no URL parameters to control the operation of the Permissions Check plugin.

Context Attributes and Types

The following table describes the context attributes that are available and their associated type.

Context key Input or Output Type Description
BLOJSOM_PERMISSION_CHECKER Output org.blojsom.plugin.permission.PermissionChecker object You may use the public boolean checkPermission(String username, String permission) method to check permission for a given username and permission.

Sample Usage

Here is a sample Velocity template snippet for using the permission checker object.

#if (!$BLOJSOM_PERMISSION_CHECKER.checkPermission("someuser", "bar"))
You do not have the bar permission!
#end

Site running on a free Atlassian Confluence Open Source Project License granted to blojsom. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.4 Build:#809 Jun 12, 2007) - Bug/feature request - Contact Administrators