Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [EMF] privileges for user and modification management
[EMF] privileges for user and modification management [message #423481] Wed, 01 October 2008 07:26 Go to next message
Tristan Faure is currently offline Tristan FaureFriend
Messages: 460
Registered: July 2009
Senior Member
Hi everybody !

i need for my work to think about modification management of an EMF model.
An user will have the possibility to define profiles with some rights
granted to them. And the editor will have to respect these rights.

BUT

I need to do this stuff working with all existing EMF editor (GMF, emf
generated, others ...) So what kind of EMF mechanism can be useful :( ???

I've looked for the Factory overriding mechanism to override the factory
and so adding data for rights management but i think it's not the good
solution so i hope you'll be able to help me ?

Thanks




Re: [EMF] privileges for user and modification management [message #423488 is a reply to message #423481] Wed, 01 October 2008 10:40 Go to previous messageGo to next message
Mario Winterer is currently offline Mario WintererFriend
Messages: 136
Registered: July 2009
Senior Member
Hi!

If you are using EMF Transactions, you could use a special validator
that checks the permissions against all notifications. An invalid
transaction will autmatically be rolled back.

Without EMF Transactions, you could add an EContentAdapter to your
ResourceSet to listen to all model changes and so check the permissions.

But without transaction support it will be difficult because throwing a
Permission-exception somewhere inside a model change operation (a
command) might result in an invalid model state. Maybe collecting all
permission-violations and calling undo on the command after its
completion would do the thing.

Best regards,
Mario


Tristan FAURE schrieb:
> Hi everybody !
>
> i need for my work to think about modification management of an EMF model.
> An user will have the possibility to define profiles with some rights
> granted to them. And the editor will have to respect these rights.
>
> BUT
>
> I need to do this stuff working with all existing EMF editor (GMF, emf
> generated, others ...) So what kind of EMF mechanism can be useful :( ???
>
> I've looked for the Factory overriding mechanism to override the factory
> and so adding data for rights management but i think it's not the good
> solution so i hope you'll be able to help me ?
>
> Thanks
Re: [EMF] privileges for user and modification management [message #423490 is a reply to message #423481] Wed, 01 October 2008 11:17 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Tristan,

The work in https://bugs.eclipse.org/bugs/show_bug.cgi?id=247130 is
potentially interesting. In general, EMF uses item providers as a
factory for commands so one could disable commands there. The property
descriptors are another point of control where you could selectively
make them read-only. A change recorder that rolls back changes that
aren't permitted along the line of what Mario suggested seems workable
as well. The transaction framework seems well suited for such a thing...


Tristan FAURE wrote:
> Hi everybody !
>
> i need for my work to think about modification management of an EMF
> model.
> An user will have the possibility to define profiles with some rights
> granted to them. And the editor will have to respect these rights.
>
> BUT
>
> I need to do this stuff working with all existing EMF editor (GMF, emf
> generated, others ...) So what kind of EMF mechanism can be useful :( ???
>
> I've looked for the Factory overriding mechanism to override the
> factory and so adding data for rights management but i think it's not
> the good solution so i hope you'll be able to help me ?
>
> Thanks


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: [EMF] privileges for user and modification management [message #423492 is a reply to message #423481] Wed, 01 October 2008 11:50 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
For a more 3 tier like approach this bug is also interesting:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=249278

Tom

Tristan FAURE schrieb:
> Hi everybody !
>
> i need for my work to think about modification management of an EMF model.
> An user will have the possibility to define profiles with some rights
> granted to them. And the editor will have to respect these rights.
>
> BUT
>
> I need to do this stuff working with all existing EMF editor (GMF, emf
> generated, others ...) So what kind of EMF mechanism can be useful :( ???
>
> I've looked for the Factory overriding mechanism to override the factory
> and so adding data for rights management but i think it's not the good
> solution so i hope you'll be able to help me ?
>
> Thanks


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: [EMF] privileges for user and modification management [message #423493 is a reply to message #423488] Wed, 01 October 2008 12:21 Go to previous message
Tristan Faure is currently offline Tristan FaureFriend
Messages: 460
Registered: July 2009
Senior Member
Hi thank you for your answer

Mario Winterer a écrit :
> Hi!
>
> If you are using EMF Transactions, you could use a special validator
> that checks the permissions against all notifications. An invalid
> transaction will autmatically be rolled back.

Yes I checked for transaction but my work need to be efficient with all
types of editors and for example emf generated editor doesn't use
transactions (i think)

>
> Without EMF Transactions, you could add an EContentAdapter to your
> ResourceSet to listen to all model changes and so check the permissions.
>
> But without transaction support it will be difficult because throwing a
> Permission-exception somewhere inside a model change operation (a
> command) might result in an invalid model state. Maybe collecting all
> permission-violations and calling undo on the command after its
> completion would do the thing.
>
> Best regards,
> Mario
>

I don't really know EContentAdapter process but for this use case it
could be better to use the mechanism design in this bug :
https://bugs.eclipse.org/bugs/show_bug.cgi?id=247130

Maybe i'll see in this direction but i also need to give user rights
information to user before modification maybe i can do that overriding
the content provider

>
> Tristan FAURE schrieb:
>> Hi everybody !
>>
>> i need for my work to think about modification management of an EMF
>> model.
>> An user will have the possibility to define profiles with some rights
>> granted to them. And the editor will have to respect these rights.
>>
>> BUT
>>
>> I need to do this stuff working with all existing EMF editor (GMF, emf
>> generated, others ...) So what kind of EMF mechanism can be useful :( ???
>>
>> I've looked for the Factory overriding mechanism to override the
>> factory and so adding data for rights management but i think it's not
>> the good solution so i hope you'll be able to help me ?
>>
>> Thanks




Previous Topic:EMF Transactions: Listen for rollbacks / clean up resources
Next Topic:[Databinding] Creating a ComboViewer for an EReference
Goto Forum:
  


Current Time: Thu Mar 28 18:02:24 GMT 2024

Powered by FUDForum. Page generated in 0.06902 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top