Skip to content

Commit

Permalink
Fix : projects now appear for developers
Browse files Browse the repository at this point in the history
  • Loading branch information
noullet committed May 2, 2012
1 parent b513b51 commit d9cc9e8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class ScrumOSController {
currentUserInstance.save()
}
//For PO / SM : WRITE - TM / SH : READ
def products = currentUserInstance ? Product.findAllByRole(currentUserInstance.username, [BasePermission.WRITE,BasePermission.READ], [cache:true, max:11]) : []
def products = currentUserInstance ? Product.findAllByRole(currentUserInstance, [BasePermission.WRITE,BasePermission.READ], [cache:true, max:11]) : []
def pCount = products?.size()

[user: currentUserInstance,
Expand Down Expand Up @@ -288,7 +288,7 @@ class ScrumOSController {
}
}

@Cacheable(cache = 'projectCache', keyGenerator = 'projectUserKeyGenerator')
//@Cacheable(cache = 'projectCache', keyGenerator = 'projectUserKeyGenerator')
def templates = {
def currentSprint = null
def product = null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -774,10 +774,10 @@ class ProjectController {

def term = '%'+params.term+'%' ?: '';
def options = [offset:params.int('offset') ?: 0, max: 9, sort: "name", order: "asc", cache:true]
def username = springSecurityService.currentUser?.username?:''
def currentUser = springSecurityService.currentUser

def products = securityService.admin(springSecurityService.authentication) ? Product.findAllByNameIlike(term, options) : Product.searchPublicAndMyProducts(username,term,options)
def total = securityService.admin(springSecurityService.authentication) ? Product.countByNameIlike(term, [cache:true]) : Product.countPublicAndMyProducts(username,term,[cache:true])[0]
def products = securityService.admin(springSecurityService.authentication) ? Product.findAllByNameIlike(term, options) : Product.searchPublicAndMyProducts(currentUser,term,options)
def total = securityService.admin(springSecurityService.authentication) ? Product.countByNameIlike(term, [cache:true]) : Product.countPublicAndMyProducts(currentUser,term,[cache:true])[0]

def results = []
products?.each {
Expand Down

0 comments on commit d9cc9e8

Please sign in to comment.