author | Lokanath Das <lokanath.das@oracle.com> |
Thu, 16 May 2013 14:50:57 -0700 | |
changeset 1305 | d11b04684351 |
permissions | -rw-r--r-- |
1305
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
1 |
/* |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
2 |
* CDDL HEADER START |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
3 |
* |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
4 |
* The contents of this file are subject to the terms of the |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
5 |
* Common Development and Distribution License (the "License"). |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
6 |
* You may not use this file except in compliance with the License. |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
7 |
* |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
8 |
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
9 |
* or http://www.opensolaris.org/os/licensing. |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
10 |
* See the License for the specific language governing permissions |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
11 |
* and limitations under the License. |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
12 |
* |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
13 |
* When distributing Covered Code, include this CDDL HEADER in each |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
14 |
* file and include the License file at usr/src/OPENSOLARIS.LICENSE. |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
15 |
* If applicable, add the following below this CDDL HEADER, with the |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
16 |
* fields enclosed by brackets "[]" replaced with your own identifying |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
17 |
* information: Portions Copyright [yyyy] [name of copyright owner] |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
18 |
* |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
19 |
* CDDL HEADER END |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
20 |
*/ |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
21 |
|
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
22 |
/* |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
23 |
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
24 |
*/ |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
25 |
|
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
26 |
package com.oracle.solaris.vp.panels.usermgr.client.swing; |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
27 |
|
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
28 |
import javax.swing.*; |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
29 |
import com.oracle.solaris.vp.util.misc.finder.Finder; |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
30 |
import com.oracle.solaris.vp.util.misc.property.*; |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
31 |
|
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
32 |
/** |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
33 |
* Implements Advanced Settings for Authenticated Profiles |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
34 |
*/ |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
35 |
public class AuthRightsSettings extends AdvancedSettings { |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
36 |
|
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
37 |
private static final String NAME = |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
38 |
Finder.getString("usermgr.advanced.auth_rights"); |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
39 |
private static final Icon ICON = Finder.getIcon( |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
40 |
"images/rights-24.png"); |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
41 |
|
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
42 |
private UserMgrPanelDescriptor panelDesc = null; |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
43 |
private UserManagedObject userObj = null; |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
44 |
private AuthRightsPanel panel = null; |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
45 |
|
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
46 |
public AuthRightsSettings() { |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
47 |
super(NAME, ICON); |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
48 |
} |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
49 |
|
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
50 |
public void setUser(UserManagedObject userObj) { |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
51 |
if (panel == null) { |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
52 |
panel = new AuthRightsPanel(panelDesc, userObj); |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
53 |
} |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
54 |
panel.setUser(userObj); |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
55 |
getProperty().update(userObj.getAuthRights(), false); |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
56 |
} |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
57 |
|
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
58 |
public void updateUser() { |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
59 |
userObj = panel.updateUser(); |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
60 |
getProperty().update(userObj.getAuthRights(), false); |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
61 |
} |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
62 |
|
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
63 |
public boolean isChanged() { |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
64 |
if (userObj != null) { |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
65 |
return (userObj.getAuthRightsProperty().isChanged()); |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
66 |
} else { |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
67 |
return false; |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
68 |
} |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
69 |
} |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
70 |
|
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
71 |
public void init(UserMgrPanelDescriptor panelDesc) { |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
72 |
this.panelDesc = panelDesc; |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
73 |
} |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
74 |
|
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
75 |
public JPanel getPanel() { |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
76 |
return panel; |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
77 |
} |
d11b04684351
16808665 User Manager Panel can assign profiles, but not authenticated profiles
Lokanath Das <lokanath.das@oracle.com>
parents:
diff
changeset
|
78 |
} |