git-svn-id: https://projects.brucker.ch/su4sml/svn/su4sml/trunk@7953 3260e6d1-4efc-4170-b0a7-36055960796d

This commit is contained in:
Manuel Krucker 2008-05-12 12:52:16 +00:00
parent 1b795ceaf7
commit b5f62db977
1 changed files with 70 additions and 0 deletions

View File

@ -38,7 +38,27 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
******************************************************************************)
(* $Id$ *)
signature REP_SECUREUML =
sig
type Subject
type Role
type RoleAssignment = (Subject * Role) list
type RoleHierarchy = (Role * Role) list
type Resource
type ActionName
type ProtectedAction
type Permission
val is_Role : Rep_Core.Classifier -> bool
val is_Permission : Rep_Core.Classifier -> bool
val is_User : Rep_Core.Classifier -> bool
val is_CompEnt : Rep_Core.Classifier -> bool
end
structure Rep_SecureUML : REP_SECUREUML =
struct
@ -88,4 +108,54 @@ type Permission = { name: string,
actions: ProtectedAction list
}
fun is_Role (Class{stereotypes,...}) =
List.exists (fn a => a = "secuml.role") stereotypes
| is_Role (AssociationClass{stereotypes,...}) =
List.exists (fn a => a = "secuml.role") stereotypes
| is_Role (Interface{stereotypes,...}) =
List.exists (fn a => a = "secuml.role") stereotypes
| is_Role (Enumeration{stereotypes,...}) =
List.exists (fn a => a = "secuml.role") stereotypes
| is_Role (Primitive{stereotypes,...}) =
List.exists (fn a => a = "secuml.role") stereotypes
| is_Role x = false
fun is_User (Class{stereotypes,...}) =
List.exists (fn a => a = "secuml.user") stereotypes
| is_User (AssociationClass{stereotypes,...}) =
List.exists (fn a => a = "secuml.user") stereotypes
| is_User (Interface{stereotypes,...}) =
List.exists (fn a => a = "secuml.user") stereotypes
| is_User (Enumeration{stereotypes,...}) =
List.exists (fn a => a = "secuml.user") stereotypes
| is_User (Primitive{stereotypes,...}) =
List.exists (fn a => a = "secuml.user") stereotypes
| is_User x = false
fun is_Permission (Class{stereotypes,...}) =
List.exists (fn a => a = "secuml.permission") stereotypes
| is_Permission (AssociationClass{stereotypes,...}) =
List.exists (fn a => a = "secuml.permission") stereotypes
| is_Permission (Interface{stereotypes,...}) =
List.exists (fn a => a = "secuml.permission") stereotypes
| is_Permission (Enumeration{stereotypes,...}) =
List.exists (fn a => a = "secuml.permission") stereotypes
| is_Permission (Primitive{stereotypes,...}) =
List.exists (fn a => a = "secuml.permission") stereotypes
| is_Permission x = false
fun is_CompEnt (Class{stereotypes,...}) =
List.exists (fn a => a = "compuml.entity") stereotypes
| is_CompEnt (AssociationClass{stereotypes,...}) =
List.exists (fn a => a = "compuml.entity") stereotypes
| is_CompEnt (Interface{stereotypes,...}) =
List.exists (fn a => a = "compuml.entity") stereotypes
| is_CompEnt (Enumeration{stereotypes,...}) =
List.exists (fn a => a = "compuml.entity") stereotypes
| is_CompEnt (Primitive{stereotypes,...}) =
List.exists (fn a => a = "compuml.entity") stereotypes
| is_CompEnt x = false
end