View Javadoc

1   /*
2    * Copyright 2007 Hippo
3    *
4    * Licensed under the Apache License, Version 2.0 (the  "License"); 
5    * you may not use this file except in compliance with the License. 
6    * You may obtain a copy of the License at
7    *
8    * http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" 
12   * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
13   * See the License for the specific language governing permissions and 
14   * limitations under the License.
15   */
16  package nl.hippo.portal.cms;
17  
18  import java.security.Principal;
19  
20  import nl.hippo.portal.domain.model.User;
21  
22  /***
23   * @version $Id: CMSUserWrapper.java 6122 2007-04-18 14:34:48Z pduin $
24   *
25   */
26  public class CMSUserWrapper implements CMSUser
27  {
28      private CMSUser cmsUser;
29      private User    user;
30      
31      public CMSUserWrapper(CMSUser cmsUser, User user)
32      {
33          this.cmsUser = cmsUser;
34          this.user = user;
35      }
36      
37      /* (non-Javadoc)
38       * @see nl.hippo.portal.cms.CMSUser#getPrincipal()
39       */
40      public Principal getPrincipal()
41      {
42          return cmsUser.getPrincipal();
43      }
44  
45      /* (non-Javadoc)
46       * @see nl.hippo.portal.cms.CMSUser#getUser()
47       */
48      public User getUser()
49      {
50          return user;
51      }
52  
53      /* (non-Javadoc)
54       * @see nl.hippo.portal.cms.CMSUser#isUserInRole(java.lang.String)
55       */
56      public boolean isUserInRole(String role)
57      {
58          return cmsUser.isUserInRole(role);
59      }
60  
61  }