Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## net.sourceforge.pebble.util
Class SecurityUtils

    java.lang.Object
      net.sourceforge.pebble.util.SecurityUtils

    public final class SecurityUtils

extends java.lang.Object

A collection of utility methods for security.

Author:
  Simon Brown

Constructor Summary
`SecurityUtils()`

Method Summary
`static PebbleUserDetails` | `getUserDetails()`
`static java.lang.String` | `getUsername()`
`static java.lang.String` | `getUsername(Authentication auth)`
`static boolean` | `isBlogAdmin()` Determines whether this user is a Pebble admin user.
`static boolean` | `isBlogAdmin(Authentication auth)` Determines whether this user is a Pebble admin user.
`static boolean` | `isBlogContributor()` Determines whether this user is a blog contributor.
`static boolean` | `isBlogContributor(Authentication auth)` Determines whether this user is a blog contributor.
`static boolean` | `isBlogOwner()` Determines whether this user is a blog owner.
`static boolean` | `isBlogOwner(Authentication auth)` Determines whether this user is a blog owner.
`static boolean` | `isBlogPublisher()` Determines whether this user is a blog publisher.
`static boolean` | `isBlogPublisher(Authentication auth)` Determines whether this user is a blog publisher.
`static boolean` | `isUserAuthenticated()`
`static boolean` | `isUserAuthorisedForBlog(Authentication auth, Blog blog)`
`static boolean` | `isUserAuthorisedForBlog(Blog blog)`
`static boolean` | `isUserAuthorisedForBlogAsBlogContributor(Authentication auth, Blog blog)`
`static boolean` | `isUserAuthorisedForBlogAsBlogContributor(Blog blog)`
`static boolean` | `isUserAuthorisedForBlogAsBlogOwner(Authentication auth, Blog blog)`
`static boolean` | `isUserAuthorisedForBlogAsBlogOwner(Blog blog)`
`static boolean` | `isUserAuthorisedForBlogAsBlogPublisher(Authentication auth, Blog blog)`
`static boolean` | `isUserAuthorisedForBlogAsBlogPublisher(Blog blog)`
`static boolean` | `isUserAuthorisedForBlogAsBlogReader(Authentication auth, Blog blog)`
`static boolean` | `isUserInRole(Authentication auth, java.lang.String role)`
`static boolean` | `isUserInRole(java.lang.String role)`
`static void` | `main(java.lang.String[] args)`
`static void` | `runAsAnonymous()`
`static void` | `runAsBlogContributor()`
`static void` | `runAsBlogOwner()`
`static void` | `runAsBlogPublisher()`
`static void` | `runAsUnauthenticated()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### SecurityUtils

    public SecurityUtils()

Method Detail

### getUsername

    public static java.lang.String getUsername()

### getUsername

    public static java.lang.String getUsername(Authentication auth)

### getUserDetails

    public static PebbleUserDetails getUserDetails()

### isUserInRole

    public static boolean isUserInRole(java.lang.String role)

### isUserInRole

    public static boolean isUserInRole(Authentication auth,
                                       java.lang.String role)

### isBlogAdmin

    public static boolean isBlogAdmin()

  Determines whether this user is a Pebble admin user.

  Returns:
    true if the user is a Pebble admin, false otherwise

### isBlogOwner

    public static boolean isBlogOwner()

  Determines whether this user is a blog owner.

  Returns:
    true if the user is a blog owner, false otherwise

### isBlogPublisher

    public static boolean isBlogPublisher()

  Determines whether this user is a blog publisher.

  Returns:
    true if the user is a blog publisher, false otherwise

### isBlogContributor

    public static boolean isBlogContributor()

  Determines whether this user is a blog contributor.

  Returns:
    true if the user is a blog contributor, false otherwise

### isBlogAdmin

    public static boolean isBlogAdmin(Authentication auth)

  Determines whether this user is a Pebble admin user.

  Returns:
    true if the user is a Pebble admin, false otherwise

### isBlogOwner

    public static boolean isBlogOwner(Authentication auth)

  Determines whether this user is a blog owner.

  Returns:
    true if the user is a blog owner, false otherwise

### isBlogPublisher

    public static boolean isBlogPublisher(Authentication auth)

  Determines whether this user is a blog publisher.

  Returns:
    true if the user is a blog publisher, false otherwise

### isBlogContributor

    public static boolean isBlogContributor(Authentication auth)

  Determines whether this user is a blog contributor.

  Returns:
    true if the user is a blog contributor, false otherwise

### runAsBlogOwner

    public static void runAsBlogOwner()

### runAsBlogPublisher

    public static void runAsBlogPublisher()

### runAsBlogContributor

    public static void runAsBlogContributor()

### runAsAnonymous

    public static void runAsAnonymous()

### runAsUnauthenticated

    public static void runAsUnauthenticated()

### isUserAuthorisedForBlogAsBlogOwner

    public static boolean isUserAuthorisedForBlogAsBlogOwner(Blog blog)

### isUserAuthorisedForBlogAsBlogPublisher

    public static boolean isUserAuthorisedForBlogAsBlogPublisher(Blog blog)

### isUserAuthorisedForBlogAsBlogContributor

    public static boolean isUserAuthorisedForBlogAsBlogContributor(Blog blog)

### isUserAuthorisedForBlogAsBlogOwner

    public static boolean isUserAuthorisedForBlogAsBlogOwner(Authentication auth,
                                                             Blog blog)

### isUserAuthorisedForBlogAsBlogPublisher

    public static boolean isUserAuthorisedForBlogAsBlogPublisher(Authentication auth,
                                                                 Blog blog)

### isUserAuthorisedForBlogAsBlogContributor

    public static boolean isUserAuthorisedForBlogAsBlogContributor(Authentication auth,
                                                                   Blog blog)

### isUserAuthorisedForBlogAsBlogReader

    public static boolean isUserAuthorisedForBlogAsBlogReader(Authentication auth,
                                                              Blog blog)

### isUserAuthorisedForBlog

    public static boolean isUserAuthorisedForBlog(Blog blog)

### isUserAuthorisedForBlog

    public static boolean isUserAuthorisedForBlog(Authentication auth,
                                                  Blog blog)

### isUserAuthenticated

    public static boolean isUserAuthenticated()

### main

    public static void main(java.lang.String[] args)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2006, Simon Brown. All Rights Reserved.