com.redhat.rhn.common.security.acl
Class ChannelAclHandler

java.lang.Object
  extended by com.redhat.rhn.common.security.acl.BaseHandler
      extended by com.redhat.rhn.common.security.acl.ChannelAclHandler
All Implemented Interfaces:
AclHandler

public class ChannelAclHandler
extends BaseHandler

ChannelAclHandler - implements ACLs associated with channel_detail.xml


Field Summary
static java.lang.String CID
           
static java.lang.String ERRATA
           
static java.lang.String NOT_GLOBAL_SUBSCRIBE
           
static java.lang.String RPM
           
static java.lang.String USER
           
 
Constructor Summary
ChannelAclHandler()
           
 
Method Summary
 boolean aclChannelExists(java.lang.Object ctx, java.lang.String[] params)
          Checks to see if a channel exists
 boolean aclChannelHasDownloads(java.lang.Object ctx, java.lang.String[] params)
          Does the channel have anything to download?
 boolean aclChannelIsClone(java.lang.Object ctx, java.lang.String[] params)
          Checks to see if a channel is a clone
 boolean aclChannelLicensed(java.lang.Object ctx, java.lang.String[] params)
          Does this channel have an associated license to be displayed? rhnChannel<--rhnChannelFamilyMembers-->rhnChannelFamily<--rhnChannelFamilyLicense
 boolean aclChannelPackagingType(java.lang.Object ctx, java.lang.String[] params)
          Does the channel handle the specified type of packaging? (??)
 boolean aclChannelSubscribable(java.lang.Object ctx, java.lang.String[] params)
          Can the channel be subscribed to?
 boolean aclChannelTypeCapable(java.lang.Object ctx, java.lang.String[] params)
          if a channel-arch is 'rpm', we are NOT capable of handling errata.
 boolean aclIsRhel5(java.lang.Object ctx, java.lang.String[] params)
          Is this a RHEL5 channel?
 boolean aclOrgChannelSetting(java.lang.Object ctx, java.lang.String[] params)
          Does the channel have the specified setting? (??)
 boolean aclUserCanAdminChannel(java.lang.Object ctx, java.lang.String[] params)
          Is the user allowed to administer the specified channel?
protected  Channel getChannel(User usr, java.util.HashMap ctx)
           
 
Methods inherited from class com.redhat.rhn.common.security.acl.BaseHandler
checkMonitoring, getAsLong
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

USER

public static final java.lang.String USER
See Also:
Constant Field Values

CID

public static final java.lang.String CID
See Also:
Constant Field Values

NOT_GLOBAL_SUBSCRIBE

public static final java.lang.String NOT_GLOBAL_SUBSCRIBE
See Also:
Constant Field Values

ERRATA

public static final java.lang.String ERRATA
See Also:
Constant Field Values

RPM

public static final java.lang.String RPM
See Also:
Constant Field Values
Constructor Detail

ChannelAclHandler

public ChannelAclHandler()
Method Detail

getChannel

protected Channel getChannel(User usr,
                             java.util.HashMap ctx)

aclUserCanAdminChannel

public boolean aclUserCanAdminChannel(java.lang.Object ctx,
                                      java.lang.String[] params)
Is the user allowed to administer the specified channel?

Parameters:
ctx - request context (user,cid)
params - check parameters
Returns:
true if allowed, false else

aclOrgChannelSetting

public boolean aclOrgChannelSetting(java.lang.Object ctx,
                                    java.lang.String[] params)
Does the channel have the specified setting? (??)

Parameters:
ctx - request context (user,cid)
params - check parameters [not_globally_subscribable]
Returns:
true if allowed, false else

aclChannelTypeCapable

public boolean aclChannelTypeCapable(java.lang.Object ctx,
                                     java.lang.String[] params)
if a channel-arch is 'rpm', we are NOT capable of handling errata. Otherwise, we -are- capable of handling errata. Currently, we only recognize 'errata' as the type in question.

Parameters:
ctx - request context (use,r cid)
params - check parameters [errata]
Returns:
true if allowed, false else

aclChannelPackagingType

public boolean aclChannelPackagingType(java.lang.Object ctx,
                                       java.lang.String[] params)
Does the channel handle the specified type of packaging? (??)

Parameters:
ctx - request context (user, cid)
params - check parameters [sysv-solaris]
Returns:
true if allowed, false else

aclChannelSubscribable

public boolean aclChannelSubscribable(java.lang.Object ctx,
                                      java.lang.String[] params)
Can the channel be subscribed to?

Parameters:
ctx - request context (user, cid)
params - check parameters
Returns:
true if allowed, false else

aclChannelLicensed

public boolean aclChannelLicensed(java.lang.Object ctx,
                                  java.lang.String[] params)
Does this channel have an associated license to be displayed? rhnChannel<--rhnChannelFamilyMembers-->rhnChannelFamily<--rhnChannelFamilyLicense

Parameters:
ctx - request context (user, cid)
params - check parameters
Returns:
true if allowed, false else

aclChannelHasDownloads

public boolean aclChannelHasDownloads(java.lang.Object ctx,
                                      java.lang.String[] params)
Does the channel have anything to download?

Parameters:
ctx - request context (user,cid)
params - check parameters
Returns:
true if allowed, false else

aclIsRhel5

public boolean aclIsRhel5(java.lang.Object ctx,
                          java.lang.String[] params)
Is this a RHEL5 channel?

Parameters:
ctx - request context (user,cid)
params - check parameters
Returns:
true if channel-vers is RHEL5, false else

aclChannelExists

public boolean aclChannelExists(java.lang.Object ctx,
                                java.lang.String[] params)
Checks to see if a channel exists

Parameters:
ctx - the map of params of the request
params - check params
Returns:
true if it does exist false otherwise

aclChannelIsClone

public boolean aclChannelIsClone(java.lang.Object ctx,
                                 java.lang.String[] params)
Checks to see if a channel is a clone

Parameters:
ctx - the map of params of the request
params - check params
Returns:
true if it is a clone