⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 aclresourcewrapper.java

📁 java 写的一个新闻发布系统
💻 JAVA
字号:
////                                   ____.//                       __/\ ______|    |__/\.     _______//            __   .____|    |       \   |    +----+       \//    _______|  /--|    |    |    -   \  _    |    :    -   \_________//   \\______: :---|    :    :           |    :    |         \________>//           |__\---\_____________:______:    :____|____:_____\//                                      /_____|////                 . . . i n   j a h i a   w e   t r u s t . . .//////// NK 24.01.2002 - added in Jahia//package org.jahia.services.acl;import org.jahia.services.usermanager.JahiaUser;/** * This is a wrapper to manipulate any resource that implements the ACLResourceInterface. * * @author  Khue Nguyen * * @see ACLResourceInterface * @version 1.0 */public final class ACLResourceWrapper{	// the resource	private ACLResourceInterface res;	//--------------------------------------------------------------------------    public ACLResourceWrapper(ACLResourceInterface res){    	this.res = res;    }    //--------------------------------------------------------------------------    /**     * Returns the res' ACL     *     * @return  Return the ACL.     */    public JahiaBaseACL getACL (){    	return res.getACL();    }    //--------------------------------------------------------------------------    /**     * Returns the res' ACL id     *     * @return  Return the res' ACL id.     */    public int getAclID (){        int id = -1;        try {            id = getACL().getID();        }        catch (JahiaACLException ex) {            // This exception should not happen ... :)        }        return id;    }    //--------------------------------------------------------------------------    /**     * Check if the user has administration access on the specified resource.     *     * @param    user    Reference to the user.     * @param siteID, the context used to retrieve the site's administrator group     *     * @return   Return true if the user has admin access for the specified res,     *           or false in any other case.     */    public final boolean checkAdminAccess (JahiaUser user, int siteID)    {        return ACLResource.checkAdminAccess (res, user, siteID);    }    //--------------------------------------------------------------------------    /**     * Check if the user has read access on the specified res.     *     * @param    user    Reference to the user.     * @param siteID, the context used to retrieve the site's administrator group     *     * @return   Return true if the user has read access for the specified res,     *           or false in any other case.     */    public final boolean checkReadAccess (JahiaUser user, int siteID)    {        return ACLResource.checkReadAccess (res, user, siteID);    }    //--------------------------------------------------------------------------    /**     * Check if the user has Write access on the specified res.     *     * @param    user    Reference to the user.     *     * @return   Return true if the user has read access for the specified res,     *           or false in any other case.     */    public final boolean checkWriteAccess (JahiaUser user, int siteID)    {        return ACLResource.checkWriteAccess (res, user, siteID);    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -