Author Topic: User authorization filter on tabs and modules  (Read 4771 times)

afro

  • Newbie
  • *
  • Posts: 19
    • View Profile
User authorization filter on tabs and modules
« on: January 06, 2009, 10:49:07 AM »
Hi,

I'm still exploring the potention of opengoo, especially with workspaces.
Rather than limiting its use to my people, I plan to expand it to people working with us and needing regularly documents we produce.
As for now, at the user level, it's possible to limit its authorization at the worspace level and also on some system issues. For our external users, we only want them to have access to the document tab, only with "read" authorization. They don't need calendars, notes, labels...
Could you expand the authorization properties so that besides worspace, we can have the tabs authorized or not so that they they are visible or not ?

Thanks

ignacio

  • Hero Member
  • *****
  • Posts: 1703
    • View Profile
Re: User authorization filter on tabs and modules
« Reply #1 on: January 07, 2009, 07:54:55 PM »
In version 1.1 tabs are always visible. You can hide them globally by editing some code. In version 1.2 you will be able to hide them globally by configuration options. But we don't yet support individual user restrictions on tabs nor we have dates as to when this would be supported. Sorry.

afro

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: User authorization filter on tabs and modules
« Reply #2 on: January 08, 2009, 11:15:03 AM »
The temporary solution I've been thinking about, indeed, is too have a second folder on my server for opengoo. A kind of "opengoo for external users" linked to the same database but with restrictions.

Would it be too much to ask you what  would I need to edit to :
- remove all the tabs but documents
- remove the tag window
- remove the "search" (they can link to the tasks...)
-  remove the "new" (no need)

Thanks

ignacio

  • Hero Member
  • *****
  • Posts: 1703
    • View Profile
Re: User authorization filter on tabs and modules
« Reply #3 on: January 09, 2009, 09:42:08 AM »
- remove all the tabs but documents
    This is done on public/assets/javascript/og/layout.js. Check this post: http://forums.opengoo.org/index.php?topic=644.msg2643#msg2643

- remove the tag window
    In the same file, near the end, remove or comment from
Code: [Select]
, {
    xtype: 'tagpanel'
up to the character before the next square bracket.

- remove the "search" (they can link to the tasks...)
    If the user doesn't have permissions on tasks, tasks won't show up in the search. You can remove anyway it by removing the div with id="searchbox" in 'application/layouts/website.php'.

-  remove the "new" (no need)
   In website.php remove the line that starts with 'var quickadd = ...'

If you use two separate installations, you have to either use database file storing or configure one installation to upload files to the 'upload' folder of the other installation. This can be changed in file init.php.

afro

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: User authorization filter on tabs and modules
« Reply #4 on: January 10, 2009, 04:50:01 PM »
Thank you, For the moment, I'll work on that solution.

bleeuwen

  • Freshman
  • *
  • Posts: 26
    • View Profile
    • Email
Re: User authorization filter on tabs and modules
« Reply #5 on: October 08, 2009, 03:35:29 PM »
Hi

when I follow the idea below, the new-option still appears.
Maybe versien 1.5.3 needs another solution.


  remove the "new" (no need)
   In website.php remove the line that starts with 'var quickadd = ...'

ignacio

  • Hero Member
  • *****
  • Posts: 1703
    • View Profile
Re: User authorization filter on tabs and modules
« Reply #6 on: October 12, 2009, 10:02:38 AM »
Hi bleeuwen,

It should still be working. Delete that line and refresh your browser. You can also comment that line, by adding two slashes at the beginning:

Code: [Select]
// var quickAdd ...

bleeuwen

  • Freshman
  • *
  • Posts: 26
    • View Profile
    • Email
Re: User authorization filter on tabs and modules
« Reply #7 on: October 16, 2009, 02:56:50 PM »
Hi Ignacio,

thanks for your answer

the new-button still appears even when I comment the line out.

Maybe a QuickAdd instance had been already created.

Is there someway to do a bit of testing??

Thanks in advance

(I tried in on Mac/OS and on Windows)

ignacio

  • Hero Member
  • *****
  • Posts: 1703
    • View Profile
Re: User authorization filter on tabs and modules
« Reply #8 on: October 16, 2009, 03:13:52 PM »
Ok, Let's see if we are talking about the same "New" button. Do you mean the "New" button at the right of the "Search" button and below the "Account" and "Help" links? If so, are you sure you are editing the correct file?

Regards.

bleeuwen

  • Freshman
  • *
  • Posts: 26
    • View Profile
    • Email
Re: User authorization filter on tabs and modules
« Reply #9 on: October 16, 2009, 03:22:01 PM »
Hi Ignacio

I mean the New button in the toolbar. See the attached screenprint.


ignacio

  • Hero Member
  • *****
  • Posts: 1703
    • View Profile
Re: User authorization filter on tabs and modules
« Reply #10 on: October 16, 2009, 04:03:36 PM »
So we were not talking about the same button :)

To disable that button you have to edit file 'public/assets/javascript/og/FileManager.js', search on line 443 for this code:

Code: [Select]
tbar:[
actions.newCO,
'-',
actions.tag,
actions.properties,
actions.zip_add,
actions.del/*,
'-',
actions.refresh*/
],

and change it to:

Code: [Select]
tbar:[
actions.tag,
actions.properties,
actions.zip_add,
actions.del/*,
'-',
actions.refresh*/
],

Note how I removed the "actions.newCo" (the "New" button) and a dash (a separator in the toolbar).

This will remove the "New" button for the "Documents" tab. If you want to do the same for other tabs you have to repeat this for files "MessageManager.js" (notes), "ContactManager.js" (contacts), "MailManager.js" (emails), "CalendarToolbar.js" (calendar: look for "this.add"), "tasks/TasksTopToolbar.js" (tasks: look for "this.add"), "WebpageManager.js" (weblinks) and "OverviewManager.js" (dashboard, view as list).

Hope this helps

bleeuwen

  • Freshman
  • *
  • Posts: 26
    • View Profile
    • Email
Re: User authorization filter on tabs and modules
« Reply #11 on: October 16, 2009, 04:52:12 PM »
Hi Ignacio

so far so good.

Now I have an other problem: I only want to disable it for a special user.

In Website.php I can manage this by putting the statement:
if (logged_user()->getUsername() === ".." )
Because I am used to php-programming

But I do not know how to solve this problem in javascript.

ignacio

  • Hero Member
  • *****
  • Posts: 1703
    • View Profile
Re: User authorization filter on tabs and modules
« Reply #12 on: October 16, 2009, 05:26:13 PM »
Do this:

On file 'application/layouts/website.php' you will see a lot of javascript variables being defined there. This file is loaded on startup and these javascript variables. So you could define there a javascript flag depending on PHP code that will tell you whether to show or not the button. Since this is loaded at startup, if the flag changes you would have to refresh your browserto see it reflected in the app, but I'm assuming you don't need this flag to change oftenly. So you could do something like this on website.php:

Code: [Select]
<?php if (logged_user()->getUsername() == "..") { ?>
og.disableTheNewButton = true;
<?php } else { ?>
og.disableTheNewButton = false;
<?php ?>

and then on FileManager.js:

Code: [Select]
tbar: og.disableTheNewButton ? [
actions.tag,
actions.properties,
actions.zip_add,
actions.del
] : [
actions.newCo,
'-',
actions.tag,
actions.properties,
actions.zip_add,
actions.del
]

There are clearer ways to write this code but this should work.

bleeuwen

  • Freshman
  • *
  • Posts: 26
    • View Profile
    • Email
Re: User authorization filter on tabs and modules
« Reply #13 on: October 17, 2009, 07:58:15 AM »
Hi Ignacio

thank you very much. It is working.

(also thanks for the java lesson)