do not at all describe "who" is able to perform the action(s)
Multiple Parts
Wildcard Permissions support the concept of multiple levels or parts. For example, you could restructure the previous simple example by granting a user the permission
printer:query
Multiple Values
Each part can contain multiple values. So instead of granting the user both the "printer:print" and "printer:query" permissions, you could simply grant them one:
printer:print,query
All Values
What if you wanted to grant a user all values in a particular part? It would be more convenient to do this than to have to manually list every value. Again, based on the wildcard character, we can do this. If the printer domain had 3 possible actions (query, print, and manage), this:
printer:query,print,manage
simply becomes this:
printer:*
Using the wildcard in this way scales better than explicitly listing actions since, if you added a new action to the application later, you don't need to update the permissions that use the wildcard character in that part.
Finally, it is also possible to use the wildcard token in any part of a wildcard permission string. For example, if you wanted to grant a user the "view" action across all domains (not just printers), you could grant this:
*:view
Then any permission check for "foo:view" would return true
"HTTP application to use Fiddler?
You can either directly configure the WinHTTP application to point to Fiddler, in code, or you can use the following command at the command prompt to tell WinHTTP to use Fiddler:
On XP or below:
proxycfg -p http=127.0.0.1:8888;https=127.0.0.1:8888
...or this one to force WinHTTP to use WinINET's proxy settings:
proxycfg -u
On Vista or above, use an Elevated (admin) command prompt:
netsh winhttp set proxy 127.0.0.1:8888
Note: On Windows 7 and earlier, netsh is bitness specific, so you may want to run the above command twice: first using the 32bit NETSH and then using the 64bit NETSH. This blog has more information. This issue was fixed in Windows 8; you can call either NetSh just once to set the proxy for both 32bit and 64bit WinHTTP hosts.
Capture traffic from a different account, like ASP.NET on IIS or from a Windows Service?
Trying to capture SOAP calls coming from ASP.NET or some background service process?
By default, Fiddler registers as the proxy only for the current user account (ASP.NET runs in a different user account). To get a background process (like the ASP.NET or IIS process) to use Fiddler, you must configure that process to use Fiddler.
Typically, this is done by editing web.config or machine.config for the ASP.NET installation, or the configuration for the code running within the Windows Service.
Please see http://msdn.microsoft.com/en-us/magazine/cc300743.aspx#S4 or the section on .NET or WinHTTP, depending on which network stack the service is using.
Configure Windows Phone 7 to use Fiddler?
Please see http://blogs.msdn.com/b/fiddler/archive/2011/01/09/debugging-windows-phone-7-device-traffic-with-fiddler.aspx for actual device hardware, or http://blogs.msdn.com/b/fiddler/archive/2010/10/15/fiddler-and-the-windows-phone-emulator.aspx for the emulator.
Configure Google Nexus 7 (Andoid 4.1 Jellybean) to use Fiddler?
Please see this page.
Configure Android Emulator to use Fiddler?
Please see http://au
If you are not a supplier, you need to work with your supplier trading partners to get a list of room types supported by their CRS (central reservation system) or PMS (property management system.)
The NIST RBAC model addresses the limitations of RBAC for enterprise-wide deployments, which typically focuses on the increased complexity of managing sufficient roles and assigning adequate role membership within a heterogeneous IT infrastructure
Higher management needs to understand that RBAC implementation has a profound impact on the way some parts of the company operate
Individual usersGroupsProject rolesIssue roles such as 'Reporter', 'Project Lead' and 'Current Assignee''Anyone' (e.g. to allow anonymous access)A (multi-)user picker custom field.A (multi-)group picker custom field. This can either be an actual group picker custom field, or a (multi-)select-list whose values are group names.
Many other permissions are dependent on this permission
example of dependencies *between* permissions. eg, in this case, work-on-issues permission 'needs' browse-projects permission
could be expressed as a permission hierarchy where if work-on-issues permission is granted, means/implies that user already has browse-projects permission (w-o-i perm 'subsumes' b-p perm)
might imply permission hierarchy
Mapping enum to database column using JPA/Hibernate
You can use any of the 3 approaches discussed above.
Map the enum to an integer column. The persistence implementation should automatically convert enum to ordinal() and back for you.
Map the enum to a String column. The persistence implementation should automatically convert the enum value to String value via the name() function.
Map the enum using a business value. You should mark the enum field as @Transient, and create another String field which you can map to a String column in your database table. Here’s an example code snippet.
view plaincopy to clipboardprint?@Entity public class Product { @Column private String colorValue; @Transient public Color getColor() { return Color.fromValue(colorValue); } public void setColor(Color color) { this.colorValue = color.toValue(); } }
Approach 3: Using a user defined business value – Recommended approach!
This approach involves assigning a an explicit user defined value to each enum constant and defining a toValue() and fromValue() methods on the enum to do the serialization and deserialization.
public enum Color { RED("RED"), GREEN("GREEN"), BLUE("BLUE"), UNKNOWN("UNKNOWN"); private final String value; Color(String value) { this.value = value; } public static Color fromValue(String value) { if (value != null) { for (Color color : values()) { if (color.value.equals(value)) { return color; } } } // you may return a default value return getDefault(); // or throw an exception // throw new IllegalArgumentException("Invalid color: " + value); } public String toValue() { return value; } public static Color getDefault() { return UNKNOWN; } } public enum Color {
RED("RED"), GREEN("GREEN"), BLUE("BLUE"), UNKNOWN("UNKNOWN");
private final String value;
Color(String value) {
this.value = value;
}
public static Color fromValue(String value) {
if (value != null) {
for (Color color : values()) {
if (color.value.equals(value)) {
return color;
}
}
}
// you may return a default value
return getDefault();
// or throw an exception
// throw new IllegalArgumentException("Invalid color: " + value);
}
public String toValue() {
return value;
}
public static Color getDefault() {
return UNKNOWN;
}
}
This approach is better than approach 1 and approach 2 above. It neither depends on the order in which the enum constants are declared nor on the constant names.
'Subject' can mean a human being, but also a 3rd party process, daemon account, or anything similar. It simply means 'the thing that is currently interacting with the software'
Subject currentUser = SecurityUtils.getSubject();
SecurityManager
SecurityManager manages security operations for all users
Realms
Realm acts as the ‘bridge’ or ‘connector’ between Shiro and your application’s security data. That is, when it comes time to actually interact with security-related data like user accounts to perform authentication (login) and authorization (access control), Shiro looks up many of these things from one or more Realms configured for an application.
Realm is essentially a security-specific DAO
Shiro provides out-of-the-box Realms to connect to a number of security data sources (aka directories) such as LDAP, relational databases (JDBC), text configuration sources like INI and properties files, and more
Authorization
A permission is a raw statement of functionality, for example ‘open a door’, ‘create a blog entry’, ‘delete the ‘jsmith’ user’, etc. By having permissions reflect your application’s raw functionality, you only need to change permission checks when you change your application’s functionality. In turn, you can assign permissions to roles or to users as necessary at runtime.
“Run As” support for assuming the identity of another Subject
Seam Security is built around the premise of users being granted roles and/or permissions, allowing them to
perform operations that may not otherwise be permissible for users without the necessary security privileges
15.6.1.1. What is a role?
A role is a group, or type, of user that may have been granted certain
privileges for performing one or more specific actions within an application
used to create logical groups of users for the convenient assignment of specific application privileges
15.6.1.2. What is a permission?
A permission is a privilege (sometimes once-off) for performing a single, specific action. It is entirely possible to
build an application using nothing but permissions, however roles offer a higher level of convenience when granting
privileges to groups of users
consisting of three
"aspects";
a target
an action
a recipient
An empty @Restrict implies a permission check of componentName:methodName
implied permission required to call the delete() method is
account:delete
equivalent of this would be to write
@Restrict("#{s:hasPermission('account','delete')}")
@Restrict annotation may reference any objects that
exist within a Seam context. This is extremely useful when performing permission checks for a specific
object instance.
selectedAccount
selectedAccount
Identity.instance().checkRestriction
If the expression specified doesn't evaluate to true, either
if the user is not logged in, a NotLoggedInException
exception is thrown or
if the user is logged in, an AuthorizationException
exception is thrown.
The reason why GraniteDS generates properties of type ListCollectionView is simple : it internally uses collections implementations that extend ListCollectionView and not ArrayCollection.
But as you have described when you manually assign collections, you should use ArrayCollection.
It’s exactly the same as in Java when you do List list = new ArrayList().
ListCollectionView/ArrayCollection tip for using GraniteDS
Troubleshooting
The org.jboss.as.jpa logging can be enabled to get the following information:
INFO - when persistence.xml has been parsed, starting of persistence unit service (per deployed persistence.xml), stopping of persistence unit service
DEBUG - informs about entity managers being injected, creating/reusing transaction scoped entity manager for active transaction
TRACE - shows how long each entity manager operation took in milliseconds, application searches for a persistence unit, parsing of persistence.xml
and allows data modifications to be queued up (like a shopping cart),
without an active JTA transaction
EXTENDED
entity lifecycle
is managed by the underlying persistence provider.
New (transient):
an entity is new if it has just been instantiated using the new operator, and it is not associated with a persistence context. It has no persistent representation in the database and no identifier value has been assigned.
Managed (persistent):
a managed entity instance is an instance with a persistent identity that is currently associated with a persistence context.
Detached:
the entity instance is an instance with a persistent identity that is no longer associated with a persistence context, usually because the persistence context was closed or the instance was evicted from the context.
Removed:
a removed entity instance is an instance with a persistent identity, associated with a persistence context, but scheduled for removal from the database.
Replacing the current Hibernate 4.0.x jars with a newer version
update the current as7/modules/org/hibernate/main folder
Delete *.index files in as7/modules/org/hibernate/main and as7/modules/org/hibernate/envers/main folders
Remove the older jars and copy new Hibernate jars into as7/modules/org/hibernate/main + as7/modules/org/hibernate/envers/main.
Update the as7/modules/org/hibernate/main/module.xml
as7/modules/org/hibernate/envers/main/module.xml to name the jars that you copied in.