I got it to work! Yay!
However there is some substantial change of how RhinoSecurity is
suppose to set up. The example that Artur use an older version of
RhinoSecurity so Security.InitializeConfiguration<YourUserImpl>(cfg)
wasn't available then.
If Security.InitializeConfiguration<YourUserImpl>(cfg) is used then
there is no need to Include the RhinoSecurity assembly into the
hibernate config file. In fact doing so will resulted in a duplicate
mapping error.
I actually got it set up correctly the first time.
However I couldn't get it to work because I used
SecurityTableStructure.Schema this is the part that I don't really
understand what is all that require if I used this instead of
SecurityTableStructure.Prefix. If somebody could explain the different
that would be great.
Anyway it's working when I changed to SecurityTableStructure.Prefix.
It's also worth noting that SchemaUpdate will fail silently(which sent
me on a wild goose chase) while SchemaExport will throw an exception
when I tried to use SecurityTableStructure.Schema
Here is the exception that got throw when I attempted to do a
SchemaExport with the SecurityTableStructure.Schema settting.
NHibernate.HibernateException was unhandled
Message="The specified schema name \"security\" either does not
exist or you do not have permission to use it."
Source="NHibernate"
StackTrace:
at NHibernate.Tool.hbm2ddl.SchemaExport.Execute(Action`1
scriptAction, Boolean export, Boolean justDrop)
at NHibernate.Tool.hbm2ddl.SchemaExport.Execute(Boolean script,
Boolean export, Boolean justDrop)
at NHibernate.Tool.hbm2ddl.SchemaExport.Create(Boolean script,
Boolean export)
at RhinoSecurity.Program.Main(String[] args) in
C:\Users\Hummy\Desktop\example\RhinoSecNhSetup\RhinoSecurity\RhinoSecurity\Program.cs:line
34
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile,
Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: System.Data.SqlClient.SqlException
Message="The specified schema name \"security\" either does not
exist or you do not have permission to use it."
Source=".Net SqlClient Data Provider"
ErrorCode=-
2146232060
Class=16
LineNumber=1
Number=2760
Procedure=""
Server="localhost\\SQLEXPRESS"
State=1
StackTrace:
at System.Data.SqlClient.SqlConnection.OnError(SqlException
exception, Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException
exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject
stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior
runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream,
BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject
stateObj)
at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String
methodName, Boolean async)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult
result, String methodName, Boolean sendToPipe)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at NHibernate.Tool.hbm2ddl.SchemaExport.Execute(Action`1
scriptAction, Boolean export, Boolean throwOnError, TextWriter
exportOutput, IDbCommand statement, String sql)
at NHibernate.Tool.hbm2ddl.SchemaExport.Execute(Action`1
scriptAction, Boolean export, Boolean justDrop, IDbConnection
connection, TextWriter exportOutput)
at NHibernate.Tool.hbm2ddl.SchemaExport.Execute(Action`1
scriptAction, Boolean export, Boolean justDrop)
InnerException: