This project has moved and is read-only. For the latest updates, please go here.

How to add new role and giving them some rights

Apr 5, 2011 at 10:17 AM

Hi,

I want a role system i.e., a new role of "executive" which is the person who will actually working on issue, "helpdesk" is one who will assign issues to their executive and "admin" will control all the roles. admin have a right to add new user directly from their accounts. how i make chages and where to run a system this way. I am using 36575 version of ticketdesk system.

Apr 6, 2011 at 1:54 AM

Not all problems require a technical solution. Based on your description, this is likely one of those cases.

The administrative user you describe would just be a member of the admin role in ticketdesk. Ticketdesk contains the features you described, and the admin role has permissions to those features.

For the other two users, basically you describe two people who are just doing different tasks within TicketDesk; one is a regular help desk staffer and the other sounds like a "traffic cop" type person -- basically just someone who's job it is to make sure new issues get routed to the right people on the helpdesk. Both of these users are conceptually IT staff members, and so both fall into the "HelpDeskStaff" security group/role that TicketDesk implements.

You do not need a fully customized permissions system that can formally distinguish between each user's specific job responsibilities. Remember, this is just an issue tracker, not banking software.

Just add both the "executive" user and the "helpdesk" user to the built-in "HelpDeskStaff" security role. This role has the appropriate permissions needed for both kinds of user. Members of this role can assign/re-assign tickets, which fits the needs of your "helpdesk" user. Similarly, this role also allows the "executive" user to perform all of the actions necessary to actually work on and resolve the issues. 

I can't identify a compelling reason to customize the code of the security system though, that's a lot of effort but doesn't seem to provide any capabilities that TicketDesk doesn't already provide.  

However; if you did want to modify the security sub-systems to add this kind of custom security then you could alter the source code as needed... but "how" to do that is well beyond the scope of a simple online discussion. Security and permission systems can range from very simple, to wildly complex; but any design you come up with has to be implemented throughout the entire system. There is no security system where you can "just make this little change and be done with it". Altering the behavior of a security system tends to impact the entire system's design; how much impact it has depends on the kind of changes and the complexity of the overall security system.  

I do have plans to replace TicketDesk's current security and permissions system with a more comprehensive and customizable one in a future release. The reason for the new security system though is to support features and usage scenarios that have not yet been implemented with ticketdesk yet; anonymous external users for public facing ticketdesk instances for example.            

Apr 6, 2011 at 7:22 AM

Hi Stephen Redd,

    first of all thank u for reply. I have already created a role of executive. for that I have add role in web.config and user and roles cs page add listbox items. that's it. as well as I need some activity buttons so that in securitymanager.cs static property and I am added this condition for assign button visibility true where u already check for isstaff or isadmin like that. for any other rights do i need changes? any other places?.

    one for thing when I am login it goes to ticketcenter2 page, where by default focus on "ALLMyTickets" hyperlink. how I change to by default focus on "ALLOpenTickets". I try a lot through your listview settings, your user control code, other cs setting but I cant success in it. pls if possible help me out.

    last If I ask my application related issues to you thats not a problem na?

    Thank u once again,

    bye

Apr 7, 2011 at 12:53 AM

In the ticket center, the default focus is on the first displayed list defined.

You can re-arrange the lists (which are what create the tabs in ticket center) by editing the static CreateNewSettings method in the ListViewSettingsCollection class. The current method just creates the default set of lists; if the user is a staff memeber they will get two additional lists. You can potentially make method much more complex.  

Please keep in mind that you have to delete the user's profile data from the database if you want it to re-generate the lists for an existing user.  

As for your security changes, there just isn't enough information for me to give you any useful advice. It sounds like you are on the right track, and that you know what you are aiming for. No suggestions come to mind. The TicketDesk 1.x security system is fairly simple in regards to the kinds of changes you are making now. It doesn't really get complex until you get into modifying the deeper active directory stuff (which you don't need to do for the kinds of modifications you are talking about).  

I don't mind discussing any TicketDesk related topics here; including helping with any custom programming.  

Apr 7, 2011 at 11:58 AM

Hey Stephen,

      Thank u once again, bcoz of ur reply regarding tab setting changes, I can able to do changes for reordering all the tabs as per my requirements with short time successfully.

now I already achieved bydefault focus on "ALLOPENTICKETS" by tab reordering. now I want if by default focus on "ALLOPENTICKETS" than all data should be display ticketid descending order compulsory. means everytime last or latest ticket should be displayed on my first page. it should be happen every time either anyone click on "ALLOPENTICKETS" hyperlink or bydefault focus on "ALLOPENTICKETS".

already I have started this task. I am checking whether "listViewSettings.ListViewName =="opentickets" than sorting should be on zero indexing i.e. ticketid column only and descending direction only., in "TicketListQueryExtensions.cs" . Its working fine, when if already ticketid setting in descending order. else if I sort (any other column ascending,ticketid column ascending)  and run website second time than it takes a setting of earlier one which i made. it not considering my setting. following is my code.  I have commented your code

 static IQueryable<Ticket> ApplyListViewSettings(this IQueryable<Ticket> ticketQuery, ListViewSettings listViewSettings, int startRowIndex)

{

 Queryable<Ticket> newQuery = ticketQuery;

 

 

//TODO: Need to modify list search to store the where clause in list settings instead of managing the query directly

 

 

if (listViewSettings.ListViewName == "opentickets")

{

newQuery = newQuery.ApplyFilters(listViewSettings);

 

//ListViewSortColumn column1 = listViewSettings.SortColumns.LastOrDefault();
 

 

//ListViewSortColumn column1 = new ListViewSortColumn();
 

 

ListViewSortColumn column1 = listViewSettings.SortColumns[0];

 

if (column1.SortDirection == ColumnSortDirection.Ascending)

{

newQuery = newQuery.ApplySort(

"TicketId", column1.SortDirection == ColumnSortDirection.Descending);

}

newQuery = newQuery.ApplySort(

"TicketId", column1.SortDirection == ColumnSortDirection.Descending);

 

}

 

else
 

{

 

if (listViewSettings.ListViewName != "search" && newQuery != null)

{

newQuery = newQuery.ApplyFilters(listViewSettings);

newQuery = newQuery.ApplySorts(listViewSettings);

}

 

else

{

newQuery = ticketQuery.ApplySorts(listViewSettings);

}

}

 

 

//if (listViewSettings.ListViewName != "search")

 

//{

 

// newQuery = newQuery.ApplyFilters(listViewSettings);

 

//}

 

//if (newQuery != null)

 

//{

 

// newQuery = newQuery.ApplySorts(listViewSettings);

 

//}

 

//else

 

//{

 

// newQuery = ticketQuery.ApplySorts(listViewSettings);

 

//}

 

return newQuery;

}

 

 

 

Apr 7, 2011 at 3:03 PM

It has been a long time since I wrote the TicketDesk 1.x code base, and this wasn't an area that got changed much in 2.x so I've not worked with this part of the code in a couple of years. BTW, was there a reason you are using the 1.x code-base instead of 2.x?

I'll take a deeper look later in the week, but right off the top of my head I would suggest that you probably should modify the parts of the code that save/update the sort settings instead of the code that applies the sort settings.

For example; in the code-behind file (ListView.ascx.cs) you could simply modify the TicketListView_ItemCommand so that it doesn't save the altered sort settings when the list is loaded.

Of course, you could also just let the users manage their own sorts and settings. I can understand having a standard default sort, but why the need to prevent them from changing it to fit their own preferences and needs individually?  Seems like a lot of trouble to code around the sorting mechanism just to force an admin-defined standard sort on just one of the lists.